mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Handle NewRelic connectivity errors
This commit is contained in:
parent
2d09ae74eb
commit
5637adf601
@ -34,14 +34,26 @@ func (widget *Widget) Refresh() {
|
||||
return
|
||||
}
|
||||
|
||||
app, _ := Application()
|
||||
deploys, _ := Deployments()
|
||||
app, appErr := Application()
|
||||
deploys, depErr := Deployments()
|
||||
|
||||
widget.View.SetTitle(fmt.Sprintf(" New Relic: [green]%s[white] ", app.Name))
|
||||
appName := "error"
|
||||
if appErr == nil {
|
||||
appName = app.Name
|
||||
}
|
||||
|
||||
widget.View.SetTitle(fmt.Sprintf(" New Relic: [green]%s[white] ", appName))
|
||||
widget.RefreshedAt = time.Now()
|
||||
|
||||
widget.View.Clear()
|
||||
|
||||
if depErr != nil {
|
||||
widget.View.SetWrap(true)
|
||||
fmt.Fprintf(widget.View, "%s", depErr)
|
||||
} else {
|
||||
widget.View.SetWrap(false)
|
||||
fmt.Fprintf(widget.View, "%s", widget.contentFrom(deploys))
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
Loading…
x
Reference in New Issue
Block a user