Skip to content

Improve Error Handling #10#11

Merged
thinkingserious merged 2 commits intosendgrid:masterfrom
shuron:master
Aug 8, 2016
Merged

Improve Error Handling #10#11
thinkingserious merged 2 commits intosendgrid:masterfrom
shuron:master

Conversation

@shuron
Copy link
Copy Markdown
Contributor

@shuron shuron commented Jul 28, 2016

This should improve error handling.
New SendGridResponseHandler was introduced, that ist capable to parse body even on http response status >300.

Also small refactoring of same code.

@thinkingserious
Copy link
Copy Markdown
Contributor

You are awesome @shuron!

Could you please submit a CLA so we can merge this? https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#cla

Thanks!

@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: cla needed labels Jul 28, 2016
@thinkingserious
Copy link
Copy Markdown
Contributor

Looks like we will need a CLA from @aholbreich too.

@aholbreich
Copy link
Copy Markdown
Contributor

You shouuld have them for @shuron and @aholbreich in the mean time.

@thinkingserious
Copy link
Copy Markdown
Contributor

Hello @aholbreich,

I have had a chance to review the pull request.

Could you please provide a usage example? Ideally, here: https://github.com/sendgrid/java-http-client/blob/master/examples/Example.java

Thank you!

@aholbreich
Copy link
Copy Markdown
Contributor

aholbreich commented Aug 3, 2016

The whole Pool request does not change API behavour of the any call off:

response = client.api(request);

it only improve the situation with verbosity of response body responses with http eror codey >=300.

I didn't wanted to break any API behaviour with this pull request, so at the end only the Exception Message is more verbouse now and containes body by chance it was send within your backend API response. e.g.

Request returned status Code 400 Body: XYZ is not accepted for being longer than ABC.

So examples applicable unchnaged.

@thinkingserious thinkingserious merged commit 79d1539 into sendgrid:master Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: community enhancement feature request not on Twilio's roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants