List of usage examples for org.springframework.web.client HttpStatusCodeException getResponseHeaders
@Nullable
public HttpHeaders getResponseHeaders()
From source file:am.ik.categolj2.app.authentication.AuthenticationHelper.java
void handleHttpStatusCodeException(HttpStatusCodeException e, RedirectAttributes attributes) throws IOException { if (logger.isInfoEnabled()) { logger.info("authentication failed (message={},X-Track={})", e.getMessage(), e.getResponseHeaders().get("X-Track")); }/*from ww w .j ava 2 s .c o m*/ try { OAuth2Exception oAuth2Exception = objectMapper.readValue(e.getResponseBodyAsByteArray(), OAuth2Exception.class); attributes.addAttribute("error", oAuth2Exception.getMessage()); } catch (JsonMappingException | JsonParseException ex) { attributes.addAttribute("error", e.getMessage()); } }