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

RetrofitError is a nightmare to work with. #284

Closed
JakeWharton opened this issue Jul 25, 2013 · 4 comments

Comments

2 participants
@JakeWharton
Copy link
Collaborator

commented Jul 25, 2013

How do you know if it was a conversion error, network error, random error inside Retrofit? Yuck. This API interaction needs rethought.

@austynmahoney

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2013

Grabbing a response body out of an error is also a pain. Some APIs return error status codes and include an error message body. In this case you need to grab the response body out of RetrofitError. There was even a pull request to try and take care of the ugly object casting code necessary to accomplish this: #243

@JakeWharton

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 26, 2013

That's what getBodyAs(Type) is for. If you want to convert the body to a string then just read the body's input stream to a string.

@JakeWharton

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 8, 2013

Discussion at #297.

@JakeWharton JakeWharton closed this Aug 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.