I am using retrofit with ReactiveX Java to implement my application. As I know, Retrofit will throws exception when a network error has occurred (ex : server internal error, server not found or no internet connection...) but when server error is 502 Bad Gateway, Retrofit does not throw any exceptions. So, can you give me all network error cases that retrofit does not throw any exceptions? Thank you so much!
As I know, Retrofit will throws exception when a network error has occurred (ex : server internal error, server not found or no internet connection...) but when server error is 502 Bad Gateway, Retrofit does not throw any exceptions
This is not correct. All non-200 responses are treated the same as an unsuccessful response.
If you specify Observable<Response<T>> then all non-200 responses will be passed to onNext as unsuccessful responses. If you specify Observable<T> then all non-200 response will be passed to onError as HttpExceptions.
Yes, thank you so much. I have understood.
Sorry @JakeWharton because I forgot ask you how to get Exception when I specified Observable<Response<T>> ?? Thank you so much.
Whenever the network fails in some way which prevents a response from being
read.
On Sun, Sep 11, 2016 at 7:35 AM jollyjoker992 [email protected]
wrote:
Sorry @JakeWharton https://github.com/JakeWharton because I forgot ask
you how to get Exception when I specified Observable> ??
Thank you so much.—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/square/retrofit/issues/2014#issuecomment-246175720,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEESJALWmM1xBT4_NAShoB5WeXDP1Sks5qo-dwgaJpZM4J55BY
.
Most helpful comment
This is not correct. All non-200 responses are treated the same as an unsuccessful response.
If you specify
Observable<Response<T>>then all non-200 responses will be passed toonNextas unsuccessful responses. If you specifyObservable<T>then all non-200 response will be passed toonErrorasHttpExceptions.