Skip to content

Commit

Permalink
Add error message for missing cloud shell (#237)
Browse files Browse the repository at this point in the history
This leads to an opaque error when running `plural shell sync`
  • Loading branch information
michaeljguarino authored Oct 21, 2022
1 parent 7b3e8cc commit 6600f38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/api/shell.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package api

import "fmt"

func (client *client) GetShell() (CloudShell, error) {
resp, err := client.pluralClient.GetShell(client.ctx)
if err != nil {
Expand All @@ -11,9 +13,9 @@ func (client *client) GetShell() (CloudShell, error) {
Id: resp.Shell.ID,
AesKey: resp.Shell.AesKey,
GitUrl: resp.Shell.GitURL,
}, err
}, nil
}
return CloudShell{}, err
return CloudShell{}, fmt.Errorf("Could not find a cloud shell for this user")
}

func (client *client) DeleteShell() error {
Expand Down

0 comments on commit 6600f38

Please sign in to comment.