title: Apache HttpClient ResponseHandler Exceptions
body: <pre><code>ResponseHandler&lt;RedditRequestResponse&gt; rh = new ResponseHandler&lt;RedditRequestResponse&gt;() {
              @Override
              public RedditRequestResponse handleResponse(
                      final HttpResponse response) throws IOException, RedditException {
                  int statusCode = response.getStatusLine().getStatusCode();
                  HttpEntity entity = response.getEntity();
  
                  if (entity == null) {
                      throw new ClientProtocolException("Response contains no content");
                  }
                  String responseBody = EntityUtils.toString(entity);
                  if (statusCode != HttpStatus.SC_OK) {
                      throw new RedditException(generateErrorString(statusCode, input, responseBody));
                  }               
  
                  return new RedditRequestResponse(statusCode, responseBody);
              }
          };
  </code></pre>
  
  <p>I'd like to throw my own <code>RedditException</code> from <code>handleResponse()</code> that includes the response body. However, when I try that (like in the above code) I get a <code>RedditException not compatible with throws clause</code> error. I suspect this has something to do with the @Override. What exactly is being overridden? The class that contains this method does not inherit from any other class and does not implement any interfaces that I can tell.</p>