title: Retrofit 2 does not parse response in case error
body: <p>I'm using Retrofit 2 in my project.
  I have a problem with below scenario.</p>
  
  <p>When I call to <code>API</code> and <code>server</code> tell me that the r<code>equest was not executed</code> with the <code>error code</code> is <code>4xx</code> or <code>500</code> with details message of the problem.</p>
  
  <p>But seems that <code>retrofit</code> understands that it's an <code>http error</code> and did not collect the <code>error message</code> from <code>Server</code>.</p>
  
  <p><strong>I see the closely same problem <a href="https://stackoverflow.com/questions/33757619/retrofit-2-null-response-body">here</a> but it was not resolved my issue.</strong></p>
  
  <p>I completely get response success and I'm sure that there no problem in my implementation.</p>
  
  <pre><code>    @Override
      public void onResponse(Response&lt;CustomResponse&gt; response, Retrofit retrofit) {
      Log.d("Response : ", response.body(), response.code()); // here i got response.body() is null if response code is not 200, if response code is 200 -- it work well as I expected.
      onRequestSuccess(response);
  }
  </code></pre>
  
  <p>I have a look at <code>Response</code> class in <code>retrofit</code> and I see below code:</p>
  
  <pre><code>  private Response(com.squareup.okhttp.Response rawResponse, T body, ResponseBody errorBody) {
         this.rawResponse = checkNotNull(rawResponse, "rawResponse == null");
         this.body = body;
         this.errorBody = errorBody;
    }
  </code></pre>
  
  <p>And </p>
  
  <pre><code>  public static &lt;T&gt; Response&lt;T&gt; error(ResponseBody body, com.squareup.okhttp.Response rawResponse) {
        return new Response&lt;&gt;(rawResponse, null, body);
    }
  </code></pre>
  
  <p>Seems that when <code>response</code> code from <code>server</code> was not <code>200</code>, <code>retrofit</code> understand that it's error and set <code>body</code> as <code>null</code>.</p>
  
  <p>So any one can help to get the "correct" value of <code>response body</code> in this case?</p>