code: public void handleError(ClientHttpResponse response) throws IOException {
  		HttpStatus statusCode = getHttpStatusCode(response);
  		switch (statusCode.series()) {
  			case CLIENT_ERROR:
  				throw new HttpClientErrorException(statusCode, response.getStatusText(),
  						response.getHeaders(), getResponseBody(response), getCharset(response));
  			case SERVER_ERROR:
  				throw new HttpServerErrorException(statusCode, response.getStatusText(),
  						response.getHeaders(), getResponseBody(response), getCharset(response));
  			default:
  				throw new RestClientException("Unknown status code [" + statusCode + "]");
  		}
  	}
docs: This default implementation throws a {@link HttpClientErrorException} if the response status code
  is {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}, a {@link HttpServerErrorException}
  if it is {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR},
  and a {@link RestClientException} in other cases.