I\'m using retrofit 2 along with rx java
Situation: the app sends some request, then i get the response in json-format that is automatically converted to User dto,
I had the same situation and the way I could get the json from the server when an error occurs was something like this:
retrofit2.Response r = call.execute();
String errorMessage = "";
try {
errorMessage = r.errorBody().string();
} catch (IOException e) {
e.printStackTrace();
}
Timber.d("errorMessage: " + errorMessage);