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
Closed

RetrofitError is a nightmare to work with. #284

JakeWharton opened this issue Jul 25, 2013 · 4 comments

Comments

@JakeWharton
Copy link
Member

@JakeWharton JakeWharton 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
Copy link
Contributor

@austynmahoney austynmahoney 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

Loading

@JakeWharton
Copy link
Member Author

@JakeWharton JakeWharton 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.

Loading

@JakeWharton
Copy link
Member Author

@JakeWharton JakeWharton commented Aug 8, 2013

Discussion at #297.

Loading

@JakeWharton JakeWharton closed this Aug 8, 2013
@lotfi10
Copy link

@lotfi10 lotfi10 commented Dec 16, 2015

When I try to make a POST request with Retrofit in Android application, I face this error:

failure : retrofit.RetrofitError: 307 Temporary Redirect

Please help me to resolve this error

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants