1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Remove some panics, replace with error percolation

This commit is contained in:
Chris Cummer 2018-04-12 08:56:33 -07:00 committed by Chris Cummer
parent 04c3effcea
commit 0472e8edec
3 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import (
func Request(apiKey string, apiURL string) ([]byte, error) {
req, err := http.NewRequest("GET", apiURL, nil)
if err != nil {
panic(err)
return nil, err
}
req.SetBasicAuth(apiKey, "x")

View File

@ -86,7 +86,7 @@ func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string {
}
str = str + fmt.Sprintf(
" [green]%s[%s] %s %-16s[white]\n",
" [green]%s[%s] %s %-.16s[white]\n",
deploy.Revision[0:8],
lineColor,
deploy.Timestamp.Format("Jan 02, 15:04 MST"),

3
wtf.go
View File

@ -1,6 +1,7 @@
package main
import (
"os"
"time"
"github.com/rivo/tview"
@ -121,6 +122,6 @@ func main() {
go refresher(stat, app)
if err := app.SetRoot(grid, true).Run(); err != nil {
panic(err)
os.Exit(1)
}
}