类 ExtractingResponseErrorHandler

java.lang.Object
cn.taketoday.web.client.DefaultResponseErrorHandler
cn.taketoday.web.client.ExtractingResponseErrorHandler
所有已实现的接口:
ResponseErrorHandler

public class ExtractingResponseErrorHandler extends DefaultResponseErrorHandler
Implementation of ResponseErrorHandler that uses HttpMessageConverters to convert HTTP error responses to RestClientExceptions.

To use this error handler, you must specify a status mapping and/or a series mapping. If either of these mappings has a match for the status code of a given ClientHttpResponse, DefaultResponseErrorHandler.hasError(ClientHttpResponse) will return true, and DefaultResponseErrorHandler.handleError(ClientHttpResponse) will attempt to use the configured message converters to convert the response into the mapped subclass of RestClientException. Note that the status mapping takes precedence over series mapping.

If there is no match, this error handler will default to the behavior of DefaultResponseErrorHandler. Note that you can override this default behavior by specifying a series mapping from HttpStatus.Series#CLIENT_ERROR and/or HttpStatus.Series#SERVER_ERROR to null.

从以下版本开始:
4.0
作者:
Simon Galperin, Arjen Poutsma, Harry Yang
另请参阅: