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":
|
case "server-stats":
|
||||||
w = &serverStatsWidget{}
|
w = &serverStatsWidget{}
|
||||||
default:
|
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))
|
w.setID(widgetIDCounter.Add(1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue