-
- HttpMessageConverterExtractor<GraphApiException> extractor =
- new HttpMessageConverterExtractor<>(
- GraphApiException.class,
- messageConverters
- );
-
- try
- {
- GraphApiException body = extractor.extractData(bufferedResponse);
- if (body != null)
- {
- // If we can get an OAuth2Exception already from the body, it is likely
- // to have more information than the header does, so just re-throw it
- // here.
- body.setHttpErrorCode(response.getRawStatusCode());
- throw body;
- }
- }
- catch (RestClientException|HttpMessageNotReadableException e)
- {
- // ignore
- }
-
- errorHandler.handleError(bufferedResponse);