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:
parent
04c3effcea
commit
0472e8edec
@ -8,7 +8,7 @@ import (
|
|||||||
func Request(apiKey string, apiURL string) ([]byte, error) {
|
func Request(apiKey string, apiURL string) ([]byte, error) {
|
||||||
req, err := http.NewRequest("GET", apiURL, nil)
|
req, err := http.NewRequest("GET", apiURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req.SetBasicAuth(apiKey, "x")
|
req.SetBasicAuth(apiKey, "x")
|
||||||
|
@ -86,7 +86,7 @@ func (widget *Widget) contentFrom(deploys []nr.ApplicationDeployment) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
str = str + fmt.Sprintf(
|
str = str + fmt.Sprintf(
|
||||||
" [green]%s[%s] %s %-16s[white]\n",
|
" [green]%s[%s] %s %-.16s[white]\n",
|
||||||
deploy.Revision[0:8],
|
deploy.Revision[0:8],
|
||||||
lineColor,
|
lineColor,
|
||||||
deploy.Timestamp.Format("Jan 02, 15:04 MST"),
|
deploy.Timestamp.Format("Jan 02, 15:04 MST"),
|
||||||
|
3
wtf.go
3
wtf.go
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
@ -121,6 +122,6 @@ func main() {
|
|||||||
go refresher(stat, app)
|
go refresher(stat, app)
|
||||||
|
|
||||||
if err := app.SetRoot(grid, true).Run(); err != nil {
|
if err := app.SetRoot(grid, true).Run(); err != nil {
|
||||||
panic(err)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user