diff --git a/api/client.go b/api/client.go index 21cb5288b8..8171568806 100644 --- a/api/client.go +++ b/api/client.go @@ -34,7 +34,7 @@ type Client struct { func NewClient(accessToken string, version string) *Client { if accessToken == "" { - panic("Access token cannot be blank") + return nil, errors.New("No api access token available. Please login with 'flyctl auth signup' or 'flyctl auth login'") } httpClient, _ := newHTTPClient() diff --git a/cmd/command.go b/cmd/command.go index aac82d1f58..56b43df417 100644 --- a/cmd/command.go +++ b/cmd/command.go @@ -276,7 +276,7 @@ func requireAppName(cmd *Command) Initializer { }, PreRun: func(ctx *cmdctx.CmdContext) error { if ctx.AppName == "" { - return fmt.Errorf("No app specified") + return fmt.Errorf("No app specified. Maybe create one with 'flyctl apps create [APPNAME]'") } if ctx.AppConfig == nil {