Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check API response and improve non-200 error #42

Merged
merged 5 commits into from
Oct 15, 2024
Merged

Conversation

jungaretti
Copy link
Owner

@jungaretti jungaretti commented Oct 15, 2024

Adds a check for res.StatusCode to print a more helpful error message when a non-200 status is returned.

Demo

./bin/bacon ping & ./bin/bacon ping & ./bin/bacon ping

New Error Message

Error: received non-success status code: 503

Original Error Message

Error: unmarshaling JSON body: invalid character '<' looking for beginning of value

@jungaretti jungaretti merged commit 5defafe into main Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant