How do I get Response body when there is an error when using Retrofit 2.0 Observables

Just check if the throwable is an instance of HttpException and then you can access the retrofit response

if (e instanceof HttpException) {
    ResponseBody body = ((HttpException) e).response().errorBody();
    ...
}

Then you can use the converter to deserialize it (or do it yourself).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)