}
+ private boolean hasGraphApiError(ClientHttpResponse response) throws IOException
+ {
+ return HttpStatus.Series.CLIENT_ERROR.equals(response.getStatusCode().series());
+ }
+
@Override
public boolean hasError(ClientHttpResponse response) throws IOException
{
- return
- HttpStatus.Series.CLIENT_ERROR.equals(response.getStatusCode().series())
- || this.parent.hasError(response);
+ return hasGraphApiError(response) || parent.hasError(response);
}
@Override
public void handleError(final ClientHttpResponse response) throws IOException
{
- GraphApiErrorResponseErrorHandler.handleError(parent, response);
- }
+ if (!hasGraphApiError(response))
+ {
+ parent.handleError(response);
+ return;
+ }
- public static void handleError(
- final ResponseErrorHandler parent,
- final ClientHttpResponse response
- )
- throws
- IOException
- {
if (response.getBody() == null)
{
// There is no body to interpret in the HTTP-message