Handle specific error for GetCodespaceToken

This commit is contained in:
Jose Garcia 2021-09-22 09:40:45 -04:00
parent 86717f14a1
commit 2a0ea1617b
2 changed files with 13 additions and 2 deletions

View file

@ -135,8 +135,12 @@ func pollForCodespace(ctx context.Context, client apiClient, log logger, duratio
log.Print(".")
token, err := client.GetCodespaceToken(ctx, user, name)
if err != nil {
// Do nothing. We expect this to fail until the codespace is provisioned
continue
if err == api.ErrNotProvisioned {
// Do nothing. We expect this to fail until the codespace is provisioned
continue
}
return nil, fmt.Errorf("failed to get codespace token: %w", err)
}
return client.GetCodespace(ctx, token, user, name)