Retrofit / OkHttp3 400 Error Body Empty
<p>I am using Retrofit 2 in my Android project.  When I hit an API endpoint using a GET method and it returns a 400 level error I can see the error content when I use an HttpLoggingInterceptor, but when I get to the Retrofit OnResponse callback the error body's string is empty.</p>

<p>I can see that there is a body to the error, but I can't seem to pull that body when in the context of the Retrofit callback.  Is there a way to ensure the body is accessible there?</p>

<p>Thanks,
Adam</p>

<p>Edit:
The response I see from the server is:
{"error":{"errorMessage":"For input string: \"000001280_713870281\"","httpStatus":400}}</p>

<p>I am trying to pull that response from the response via:
<code>
BaseResponse baseResponse = GsonHelper.getObject(BaseResponse.class, response.errorBody().string());
if (baseResponse != null &amp;&amp; !TextUtils.isEmpty(baseResponse.getErrorMessage()))
     error = baseResponse.getErrorMessage();</code></p>

<p>(GsonHelper is just a helper which passes the JSON string through GSON to pull the object of type <code>BaseResponse</code>)</p>

<p>The call to response.errorBody().string() results in an IOException: Content-Length and stream length disagree, but I see the content literally 2 lines above in Log Cat</p>