X-Git-Url: https://juplo.de/gitweb/?p=facebook-errors;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Fclient%2FGraphApiErrorHandler.java;h=a8b2d28595c2b049c94a5b488147b95a1a2f6bb0;hp=2b73e4918741fd66d29967f50565dd8696344d2c;hb=d4becb14d3018c81601b8bd43c21ea51cc4f67d7;hpb=48b14bf1e4e2fafdaa26bffcafa10a11a6312b38 diff --git a/src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java b/src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java index 2b73e49..a8b2d28 100644 --- a/src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java +++ b/src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java @@ -16,12 +16,12 @@ import org.springframework.web.client.ResponseErrorHandler; * Error-Handler for error-messages from the Facebook Graph-API. *

* This error-handler handels responses withe the HTTP-status code - * {@code 4xx}. It tries to extract and parse the error-message + * {@code 400 BAD REQUEST}. It tries to extract and parse the error-message * from the HTTP-body. Successfully extracted and parsed messages are mapped * to a hierarchy of exceptions, that reflects the hierarchy of the error- * codes and -types. *

- * If the HTTP-status-code of the response is not {@code 4xx} or + * If the HTTP-status-code of the response is not {@code 400 BAD REQUEST} or * the HTTP-body could not be extracted or parsed, this error-handler * delegates the handling to its parent. * @@ -51,10 +51,9 @@ public class GraphApiErrorHandler implements ResponseErrorHandler @Override public void handleError(final ClientHttpResponse response) throws IOException { - if (!HttpStatus.Series.CLIENT_ERROR.equals(response.getStatusCode().series())) + if (!HttpStatus.BAD_REQUEST.equals(response.getStatusCode())) { - // Let the parent-error-handler handle all errors, that are no client - // errors (4xx). + // We will only handle 400 BAD REQUEST parent.handleError(response); return; }