Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
handle non 200 resp
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jul 16, 2019
1 parent f8456a4 commit 15616f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ func HttpClient(params ...string) error {
if err != nil {
Error.Fatalln("Error in response:\n", err)
return err
} else if resp.StatusCode != 200 {
} else if resp.StatusCode > 299 {
Error.Fatalln("Response Code:\n", resp.StatusCode)
Error.Fatalln("Error in response:\n", string(body))
return errors.New("Error in response")
} else {
Expand Down

0 comments on commit 15616f2

Please sign in to comment.