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

Improve Error Handling #10

Closed
boazca opened this issue Jul 24, 2016 · 3 comments
Closed

Improve Error Handling #10

boazca opened this issue Jul 24, 2016 · 3 comments
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@boazca
Copy link

boazca commented Jul 24, 2016

In The Client you use BasicResponseHandler to handle the response.
The problem is that when the status code is >= 300 HttpResponseException is thrown, ignoring the response body.
In Sendgrid v3 web API all the details of the failure are in the response body.
so when there is a failure, you have no information about what caused the problem.

You should either insert the response body to the exception message or return your Response even if the status code is >=300 (I think the second option is better).

@thinkingserious thinkingserious changed the title No details when request fails Improve Error Handling Jul 25, 2016
@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: help wanted requesting help from the community labels Jul 25, 2016
@thinkingserious
Copy link
Contributor

Thanks for the feedback @boazca!

This is on our roadmap and we appreciate your detailed feedback. I'll leave this ticket open to track when we implement this.

@thinkingserious
Copy link
Contributor

@boazca,

This issue is resolved now: https://github.com/sendgrid/java-http-client/releases/tag/v2.3.3

Thanks again for the feedback!

I'll next be updating the dependency at sendgrid-java

@ifcwlme
Copy link

ifcwlme commented Nov 13, 2018

I think the problem haven't solved yet.

I am trying to get error response message from Response object. But the api call throws IOException, which should happen only when there is network error.
1

For http response code 400, 401, 413 error, It should be handled by Response java object, instead of IOException.

2

The relevant source code is in executeApiCall in com.sendgrid.Client.
3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

3 participants