From 5c65cfd2498785d82617357d0ce49ffc8a78c7c2 Mon Sep 17 00:00:00 2001 From: Jose Garcia Date: Thu, 2 Sep 2021 13:42:52 -0400 Subject: [PATCH 1/2] ignore any 7 err code in start --- api/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api.go b/api/api.go index 08ca2c370..470c99695 100644 --- a/api/api.go +++ b/api/api.go @@ -278,8 +278,8 @@ func (a *API) StartCodespace(ctx context.Context, token string, codespace *Codes if len(b) > 100 { b = append(b[:97], "..."...) } - if resp.StatusCode == http.StatusServiceUnavailable && strings.TrimSpace(string(b)) == "7" { - // HTTP 503 with error code 7 (EnvironmentNotShutdown) is benign. + if strings.TrimSpace(string(b)) == "7" { + // NON HTTP 200 with error code 7 (EnvironmentNotShutdown) is benign. // Ignore it. } else { return fmt.Errorf("failed to start codespace: %s", b) From 090af2290b186306f27e75c112afeed7df25b8d5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Date: Thu, 2 Sep 2021 14:13:40 -0400 Subject: [PATCH 2/2] pr feedback --- api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api.go b/api/api.go index 470c99695..7bb43811a 100644 --- a/api/api.go +++ b/api/api.go @@ -279,7 +279,7 @@ func (a *API) StartCodespace(ctx context.Context, token string, codespace *Codes b = append(b[:97], "..."...) } if strings.TrimSpace(string(b)) == "7" { - // NON HTTP 200 with error code 7 (EnvironmentNotShutdown) is benign. + // Non-HTTP 200 with error code 7 (EnvironmentNotShutdown) is benign. // Ignore it. } else { return fmt.Errorf("failed to start codespace: %s", b)