Improve error message when widget type not specified
This commit is contained in:
parent
5d12d934b8
commit
2738613344
1 changed files with 4 additions and 1 deletions
|
@ -76,7 +76,10 @@ func newWidget(widgetType string) (widget, error) {
|
|||
case "server-stats":
|
||||
w = &serverStatsWidget{}
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown widget type: %s", widgetType)
|
||||
return nil, fmt.Errorf(
|
||||
"unknown widget type: %s",
|
||||
ternary(widgetType == "", "'type' property is empty or not specified", widgetType),
|
||||
)
|
||||
}
|
||||
|
||||
w.setID(widgetIDCounter.Add(1))
|
||||
|
|
Loading…
Add table
Reference in a new issue