Skip to content

Commit

Permalink
Merge pull request #205 from cho4036/develop
Browse files Browse the repository at this point in the history
bug fix: fix error code handling
  • Loading branch information
ktkfree authored Nov 14, 2023
2 parents d3475c8 + 409491e commit 0e78ed6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/api-client/api-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (c *ApiClientImpl) callWithBody(prefix string, method string, path string,
res.Body.Close()
}()

if res.StatusCode%100 != 2 {
if res.StatusCode < 200 || res.StatusCode >= 300 {
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)
Expand Down

0 comments on commit 0e78ed6

Please sign in to comment.