From eed642a095fc7a83074c51d461b45149521388b3 Mon Sep 17 00:00:00 2001 From: donggyu Date: Thu, 26 Oct 2023 19:12:22 +0900 Subject: [PATCH] trivial. handling 2xx http status code --- pkg/api-client/api-client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api-client/api-client.go b/pkg/api-client/api-client.go index 47f1ef05..dd8549e5 100644 --- a/pkg/api-client/api-client.go +++ b/pkg/api-client/api-client.go @@ -140,7 +140,7 @@ func (c *ApiClientImpl) callWithBody(prefix string, method string, path string, res.Body.Close() }() - if res.StatusCode != 200 { + if res.StatusCode%100 != 2 { var restError httpErrors.RestError if err := json.Unmarshal(body, &restError); err != nil { return nil, fmt.Errorf("Invalid http status. failed to unmarshal body : %s", err)