1 package de.juplo.facebook.errors;
4 import java.io.IOException;
6 import org.springframework.http.HttpStatus;
7 import org.springframework.http.client.ClientHttpResponse;
8 import org.springframework.http.converter.HttpMessageConverter;
9 import org.springframework.security.oauth2.client.http.OAuth2ErrorHandler;
10 import org.springframework.web.client.ResponseErrorHandler;
18 public class OAuth2GraphApiErrorHandler extends OAuth2ErrorHandler
20 private final OAuth2ErrorHandler parent;
23 public OAuth2GraphApiErrorHandler(OAuth2ErrorHandler handler)
31 public boolean hasError(ClientHttpResponse response) throws IOException
34 HttpStatus.Series.CLIENT_ERROR.equals(response.getStatusCode().series())
35 || parent.hasError(response);
39 public void handleError(ClientHttpResponse response) throws IOException
41 GraphApiErrorHandler.handleError(parent, response);
45 public void setMessageConverters(List<HttpMessageConverter<?>> converters)
47 parent.setMessageConverters(converters);