I am using the Retrofit library to do REST calls to a service I am using.
If I make an API call to my service and have a failure, the service returns a bit of JSON
Try this code
@Override
public void failure(RetrofitError error) {
String json = new String(((TypedByteArray)error.getResponse().getBody()).getBytes());
Log.v("failure", json.toString());
}
with Retrofit 2.0
@Override
public void onFailure(Call call, Throwable t) {
String message = t.getMessage();
Log.d("failure", message);
}