Skip to content

Commit

Permalink
Avoid panic in status when api server is down.
Browse files Browse the repository at this point in the history
  • Loading branch information
codepope committed Oct 28, 2020
1 parent 082d733 commit c44e9d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func runStatus(ctx *cmdctx.CmdContext) error {
if err != nil {
return err
}

if app.Deployed {
_, backupregions, err = ctx.Client.API().ListAppRegions(ctx.AppName)

Expand All @@ -79,6 +80,11 @@ func runStatus(ctx *cmdctx.CmdContext) error {
}
} else {
app, err = ctx.Client.API().GetAppStatus(ctx.AppName, ctx.Config.GetBool("all"))

if err != nil {
return err
}

if app.Deployed {
_, backupregions, err = ctx.Client.API().ListAppRegions(ctx.AppName)

Expand Down

0 comments on commit c44e9d6

Please sign in to comment.