title: Using Spring RestTemplate, how can I log the response when there is an error?
body: <p>Spring RestTemplate could set the errorHandler, which has the methods for handling errors. I have an error handler like this</p>
  
  <pre><code>try (BufferedReader buffer = new BufferedReader(new InputStreamReader(clientHttpResponse.getBody()))) {
       final String response = buffer.lines().collect(Collectors.joining("\n"));
       System.out.println(response);
    }
  </code></pre>
  
  <p>but it always tell me that the input stream is close. Is this a bug or do I missing something?</p>