Package org.springframework.web.client
Class HttpClientErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.client.RestClientException
org.springframework.web.client.RestClientResponseException
org.springframework.web.client.HttpStatusCodeException
org.springframework.web.client.HttpClientErrorException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- HttpClientErrorException.BadRequest,- HttpClientErrorException.Conflict,- HttpClientErrorException.Forbidden,- HttpClientErrorException.Gone,- HttpClientErrorException.MethodNotAllowed,- HttpClientErrorException.NotAcceptable,- HttpClientErrorException.NotFound,- HttpClientErrorException.TooManyRequests,- HttpClientErrorException.Unauthorized,- HttpClientErrorException.UnprocessableEntity,- HttpClientErrorException.UnsupportedMediaType
Exception thrown when an HTTP 4xx is received.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classHttpClientErrorExceptionfor status HTTP 400 Bad Request.static final classHttpClientErrorExceptionfor status HTTP 409 Conflict.static final classHttpClientErrorExceptionfor status HTTP 403 Forbidden.static final classHttpClientErrorExceptionfor status HTTP 410 Gone.static final classHttpClientErrorExceptionfor status HTTP 405 Method Not Allowed.static final classHttpClientErrorExceptionfor status HTTP 406 Not Acceptable.static final classHttpClientErrorExceptionfor status HTTP 404 Not Found.static final classHttpClientErrorExceptionfor status HTTP 429 Too Many Requests.static final classHttpClientErrorExceptionfor status HTTP 401 Unauthorized.static final classHttpClientErrorExceptionfor status HTTP 422 Unprocessable Entity.static final classHttpClientErrorExceptionfor status HTTP 415 Unsupported Media Type.
- 
Constructor SummaryConstructorsConstructorDescriptionHttpClientErrorException(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset) Constructor with a status code and status text, headers, and content, and an prepared message.HttpClientErrorException(HttpStatus statusCode) Constructor with a status code only.HttpClientErrorException(HttpStatus statusCode, String statusText) Constructor with a status code and status text.HttpClientErrorException(HttpStatus statusCode, String statusText, byte[] body, Charset responseCharset) Constructor with a status code and status text, and content.HttpClientErrorException(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset) Constructor with a status code and status text, headers, and content.
- 
Method SummaryModifier and TypeMethodDescriptionstatic HttpClientErrorExceptioncreate(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) Variant ofcreate(HttpStatus, String, HttpHeaders, byte[], Charset)with an optional prepared message.static HttpClientErrorExceptioncreate(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) CreateHttpClientErrorExceptionor an HTTP status specific sub-class.Methods inherited from class org.springframework.web.client.HttpStatusCodeExceptiongetStatusCodeMethods inherited from class org.springframework.web.client.RestClientResponseExceptiongetRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseBodyAsString, getResponseHeaders, getStatusTextMethods inherited from class org.springframework.core.NestedRuntimeExceptioncontains, getMessage, getMostSpecificCause, getRootCauseMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
HttpClientErrorExceptionConstructor with a status code only.
- 
HttpClientErrorExceptionConstructor with a status code and status text.
- 
HttpClientErrorExceptionpublic HttpClientErrorException(HttpStatus statusCode, String statusText, @Nullable byte[] body, @Nullable Charset responseCharset) Constructor with a status code and status text, and content.
- 
HttpClientErrorExceptionpublic HttpClientErrorException(HttpStatus statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable Charset responseCharset) Constructor with a status code and status text, headers, and content.
- 
HttpClientErrorExceptionpublic HttpClientErrorException(String message, HttpStatus statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable Charset responseCharset) Constructor with a status code and status text, headers, and content, and an prepared message.- Since:
- 5.2.2
 
 
- 
- 
Method Details- 
createpublic static HttpClientErrorException create(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset) CreateHttpClientErrorExceptionor an HTTP status specific sub-class.- Since:
- 5.1
 
- 
createpublic static HttpClientErrorException create(@Nullable String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset) Variant ofcreate(HttpStatus, String, HttpHeaders, byte[], Charset)with an optional prepared message.- Since:
- 5.2.2
 
 
-