Package org.springframework.web.client
Interface ResponseErrorHandler
- All Known Implementing Classes:
- DefaultResponseErrorHandler,- ExtractingResponseErrorHandler,- NoOpResponseErrorHandler
public interface ResponseErrorHandler
Strategy interface used by the 
RestTemplate to determine
 whether a particular response has an error or not.- Since:
- 3.0
- Author:
- Arjen Poutsma
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidhandleError(URI url, HttpMethod method, ClientHttpResponse response) Alternative tohandleError(ClientHttpResponse)with extra information providing access to the request URL and HTTP method.voidhandleError(ClientHttpResponse response) Handle the error in the given response.booleanhasError(ClientHttpResponse response) Indicate whether the given response has any errors.
- 
Method Details- 
hasErrorIndicate whether the given response has any errors.Implementations will typically inspect the HttpStatusof the response.- Parameters:
- response- the response to inspect
- Returns:
- trueif the response indicates an error;- falseotherwise
- Throws:
- IOException- in case of I/O errors
 
- 
handleErrorHandle the error in the given response.This method is only called when hasError(ClientHttpResponse)has returnedtrue.- Parameters:
- response- the response with the error
- Throws:
- IOException- in case of I/O errors
 
- 
handleErrordefault void handleError(URI url, HttpMethod method, ClientHttpResponse response) throws IOException Alternative tohandleError(ClientHttpResponse)with extra information providing access to the request URL and HTTP method.- Parameters:
- url- the request URL
- method- the HTTP method
- response- the response with the error
- Throws:
- IOException- in case of I/O errors
- Since:
- 5.0
 
 
-