接口 ResponseErrorHandler
- 所有已知实现类:
DefaultResponseErrorHandler
public interface ResponseErrorHandler
Strategy interface used by theRestTemplate
to determine whether a particular response has an error or not.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
handleError(ClientHttpResponse response)
Handle the error in the given response.boolean
hasError(ClientHttpResponse response)
Indicate whether the given response has any errors.
方法详细资料
hasError
boolean hasError(ClientHttpResponse response) throws IOException
Indicate whether the given response has any errors.Implementations will typically inspect the
HttpStatus
of the response.- 参数:
response
- the response to inspect- 返回:
true
if the response indicates an error;false
otherwise- 抛出:
IOException
- in case of I/O errors
handleError
void handleError(ClientHttpResponse response) throws IOException
Handle the error in the given response.This method is only called when
hasError(ClientHttpResponse)
has returnedtrue
.- 参数:
response
- the response with the error- 抛出:
IOException
- in case of I/O errors