mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-25 12:21:41 +02:00
Improve error message when widget type not specified
This commit is contained in:
parent
5d12d934b8
commit
2738613344
@ -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…
x
Reference in New Issue
Block a user