Class ProblemResponseErrorHandler

java.lang.Object
org.springframework.web.client.DefaultResponseErrorHandler
io.github.belgif.rest.problem.spring.ProblemResponseErrorHandler
All Implemented Interfaces:
org.springframework.web.client.ResponseErrorHandler

@Component public class ProblemResponseErrorHandler extends org.springframework.web.client.DefaultResponseErrorHandler
RestTemplate error handler that converts problem responses to Problem exceptions.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProblemResponseErrorHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleError(URI url, org.springframework.http.HttpMethod method, org.springframework.http.client.ClientHttpResponse response)
     

    Methods inherited from class org.springframework.web.client.DefaultResponseErrorHandler

    getCharset, getResponseBody, handleError, handleError, hasError, hasError, hasError, initBodyConvertFunction

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProblemResponseErrorHandler

      public ProblemResponseErrorHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • handleError

      public void handleError(URI url, org.springframework.http.HttpMethod method, org.springframework.http.client.ClientHttpResponse response) throws IOException
      Specified by:
      handleError in interface org.springframework.web.client.ResponseErrorHandler
      Overrides:
      handleError in class org.springframework.web.client.DefaultResponseErrorHandler
      Throws:
      IOException