I am trying to connect to rest service via retrofit in android application. I am getting responses. But when there is some error response from the service, conversion exception
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);
}