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
ConstructorsConstructorDescriptionProblemResponseErrorHandler
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
-
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 interfaceorg.springframework.web.client.ResponseErrorHandler
- Overrides:
handleError
in classorg.springframework.web.client.DefaultResponseErrorHandler
- Throws:
IOException
-