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

Add HTTP error message from peer to error returned from httpGetter.Get #46

Merged

Conversation

MarnixBouhuis
Copy link
Contributor

Currently errors returned when making requests to peers only contain the status code returned by the peer. Most of the time this will be a 500 error. The real error reason is returned by the peer in the response body.

This PR adds the error message from the peer to the error returned by the httpGetter.Get method. I've limited the error message to max 10 MiB to limit to prevent possible chaos when peers start returning errors of multiple GB's or something 😃.

@MarnixBouhuis MarnixBouhuis force-pushed the add-peer-error-message-to-error branch from 09bd4ad to 131b5ec Compare July 14, 2022 10:14
Copy link
Contributor

@thrawn01 thrawn01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awesome addition! I think 10Mib might be a bit excessive? How about 1Mib? In any case, I'll merge to tag the PR at the end of the week.

@thrawn01 thrawn01 merged commit abdfdfb into mailgun:master Jul 28, 2022
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.

None yet

2 participants