mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-389 Log an exception and terminate if widget config is invalid
If, on startup, a widget's positional configuration is invalid (ie: cannot be displayed onscreen) then terminate the app and inform about which widget is erroring
This commit is contained in:
@@ -64,7 +64,7 @@ func (widget *Widget) Refresh() {
|
||||
|
||||
if err != nil {
|
||||
widget.View.SetWrap(true)
|
||||
widget.View.SetTitle(widget.Name)
|
||||
widget.View.SetTitle(widget.Name())
|
||||
widget.View.SetText(err.Error())
|
||||
} else {
|
||||
var stories []Story
|
||||
@@ -94,7 +94,7 @@ func (widget *Widget) display() {
|
||||
widget.View.SetWrap(false)
|
||||
|
||||
widget.View.Clear()
|
||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %sstories", widget.Name, wtf.Config.UString("wtf.mods.hackernews.storyType", "top"))))
|
||||
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %sstories", widget.Name(), wtf.Config.UString("wtf.mods.hackernews.storyType", "top"))))
|
||||
widget.View.SetText(widget.contentFrom(widget.stories))
|
||||
widget.View.Highlight(strconv.Itoa(widget.selected)).ScrollToHighlight()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user