java.lang.Object | |
↳ | org.springframework.web.client.DefaultResponseErrorHandler |
Default implementation of the ResponseErrorHandler
interface.
This error handler checks for the status code on the ClientHttpResponse
: any code with series
CLIENT_ERROR
or
SERVER_ERROR
is considered to be an error.
This behavior can be changed by overriding the hasError(HttpStatus)
method.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Handles the error in the given response.
The default implementation throws a | |||||||||||
Delegates to
hasError(HttpStatus) with the response status code. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Template method called from
hasError(ClientHttpResponse) . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.web.client.ResponseErrorHandler
|
Handles the error in the given response.
This method is only called when hasError(ClientHttpResponse)
has returned true
.
The default implementation throws a HttpClientErrorException
if the response status code is
CLIENT_ERROR
, a HttpServerErrorException
if it is
SERVER_ERROR
, and a RestClientException
in other
cases.
response | the response with the error |
---|
IOException |
---|
Delegates to hasError(HttpStatus)
with the response status code.
response | the response to inspect |
---|
true
if the response has an error; false
otherwiseIOException |
---|
Template method called from hasError(ClientHttpResponse)
.
The default implementation checks if the given status code is
CLIENT_ERROR
or SERVER_ERROR
. Can be overridden in subclasses.
statusCode | the HTTP status code |
---|
true
if the response has an error; false
otherwise