1
0
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:
Chris Cummer
2019-04-12 05:25:55 -07:00
parent c9c7e124cc
commit aa313bdaa4
30 changed files with 84 additions and 50 deletions

View File

@@ -57,7 +57,7 @@ func (widget *Widget) Refresh() {
if err != nil {
widget.result = nil
widget.View.SetWrap(true)
widget.View.SetTitle(widget.Name)
widget.View.SetTitle(widget.Name())
widget.View.SetText(err.Error())
} else {
widget.result = searchResult
@@ -74,7 +74,7 @@ func (widget *Widget) display() {
}
widget.View.SetWrap(false)
str := fmt.Sprintf("%s- [green]%s[white]", widget.Name, wtf.Config.UString("wtf.mods.jira.project"))
str := fmt.Sprintf("%s- [green]%s[white]", widget.Name(), wtf.Config.UString("wtf.mods.jira.project"))
widget.View.Clear()
widget.View.SetTitle(widget.ContextualTitle(str))