spring-framework / org.springframework.web.client / ExtractingResponseErrorHandler / setStatusMapping

setStatusMapping

open fun setStatusMapping(statusMapping: MutableMap<HttpStatus, Class<out RestClientException>>): Unit

Set the mapping from HTTP status code to RestClientException subclass. If this mapping has a match for the status code of a given ClientHttpResponse, #hasError(ClientHttpResponse) will return true and #handleError(ClientHttpResponse) will attempt to use the configured message converters to convert the response into the mapped subclass of RestClientException.