Top Description Inners Fields Constructors Methods
org.springframework.web.client

public Class HttpClientErrorException

extends HttpStatusCodeException
Class Inheritance
Known Direct Subclasses
org.springframework.web.client.HttpClientErrorException.BadRequest, org.springframework.web.client.HttpClientErrorException.Unauthorized, org.springframework.web.client.HttpClientErrorException.Forbidden, org.springframework.web.client.HttpClientErrorException.NotFound, org.springframework.web.client.HttpClientErrorException.MethodNotAllowed, org.springframework.web.client.HttpClientErrorException.NotAcceptable, org.springframework.web.client.HttpClientErrorException.Conflict, org.springframework.web.client.HttpClientErrorException.Gone, org.springframework.web.client.HttpClientErrorException.UnsupportedMediaType, org.springframework.web.client.HttpClientErrorException.UnprocessableEntity, org.springframework.web.client.HttpClientErrorException.TooManyRequests
Imports
java.nio.charset.Charset, org.springframework.http.HttpHeaders, .HttpStatus, .HttpStatusCode, org.springframework.lang.Nullable

Exception thrown when an HTTP 4xx is received.
Author
Arjen Poutsma
Since
3.0
See Also
DefaultResponseErrorHandler

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
HttpClientErrorException(HttpStatusCode statusCode)

Constructor with a status code only.

public
HttpClientErrorException(HttpStatusCode statusCode, String statusText)

Constructor with a status code and status text.

public
HttpClientErrorException(HttpStatusCode statusCode, String statusText, byte[] body, Charset responseCharset)

Constructor with a status code and status text, and content.

public
HttpClientErrorException(HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset)

Constructor with a status code and status text, headers, and content.

public
HttpClientErrorException(String message, HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset)

Constructor with a status code and status text, headers, and content, and a prepared message.

Method Summary

Modifier and TypeMethod and Description
public static HttpClientErrorException
create(HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Create HttpClientErrorException or an HTTP status specific subclass.

public static HttpClientErrorException
create(String message, HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Variant of create(HttpStatusCode, String, HttpHeaders, byte[], Charset) with an optional prepared message.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.springframework.web.client.HttpStatusCodeException.serialVersionUID.

Constructor Detail

HttpClientErrorExceptionback to summary
public HttpClientErrorException(HttpStatusCode statusCode)

Constructor with a status code only.

HttpClientErrorExceptionback to summary
public HttpClientErrorException(HttpStatusCode statusCode, String statusText)

Constructor with a status code and status text.

HttpClientErrorExceptionback to summary
public HttpClientErrorException(HttpStatusCode statusCode, String statusText, byte[] body, Charset responseCharset)

Constructor with a status code and status text, and content.

HttpClientErrorExceptionback to summary
public HttpClientErrorException(HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset)

Constructor with a status code and status text, headers, and content.

HttpClientErrorExceptionback to summary
public HttpClientErrorException(String message, HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset)

Constructor with a status code and status text, headers, and content, and a prepared message.

Since
5.2.2

Method Detail

createback to summary
public static HttpClientErrorException create(HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Create HttpClientErrorException or an HTTP status specific subclass.

Since
5.1
createback to summary
public static HttpClientErrorException create(String message, HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Variant of create(HttpStatusCode, String, HttpHeaders, byte[], Charset) with an optional prepared message.

Since
5.2.2
org.springframework.web.client back to summary

public final Class HttpClientErrorException.BadRequest

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 400 Bad Request.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
BadRequest(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
BadRequest(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

BadRequestback to summary
private BadRequest(String statusText, HttpHeaders headers, byte[] body, Charset charset)
BadRequestback to summary
private BadRequest(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.Conflict

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 409 Conflict.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
Conflict(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
Conflict(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

Conflictback to summary
private Conflict(String statusText, HttpHeaders headers, byte[] body, Charset charset)
Conflictback to summary
private Conflict(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.Forbidden

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 403 Forbidden.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
Forbidden(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
Forbidden(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

Forbiddenback to summary
private Forbidden(String statusText, HttpHeaders headers, byte[] body, Charset charset)
Forbiddenback to summary
private Forbidden(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.Gone

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 410 Gone.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
Gone(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
Gone(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

Goneback to summary
private Gone(String statusText, HttpHeaders headers, byte[] body, Charset charset)
Goneback to summary
private Gone(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.MethodNotAllowed

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 405 Method Not Allowed.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
MethodNotAllowed(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
MethodNotAllowed(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

MethodNotAllowedback to summary
private MethodNotAllowed(String statusText, HttpHeaders headers, byte[] body, Charset charset)
MethodNotAllowedback to summary
private MethodNotAllowed(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.NotAcceptable

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 406 Not Acceptable.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
NotAcceptable(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
NotAcceptable(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

NotAcceptableback to summary
private NotAcceptable(String statusText, HttpHeaders headers, byte[] body, Charset charset)
NotAcceptableback to summary
private NotAcceptable(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.NotFound

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 404 Not Found.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
NotFound(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
NotFound(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

NotFoundback to summary
private NotFound(String statusText, HttpHeaders headers, byte[] body, Charset charset)
NotFoundback to summary
private NotFound(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.TooManyRequests

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 429 Too Many Requests.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
TooManyRequests(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
TooManyRequests(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

TooManyRequestsback to summary
private TooManyRequests(String statusText, HttpHeaders headers, byte[] body, Charset charset)
TooManyRequestsback to summary
private TooManyRequests(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.Unauthorized

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 401 Unauthorized.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
Unauthorized(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
Unauthorized(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

Unauthorizedback to summary
private Unauthorized(String statusText, HttpHeaders headers, byte[] body, Charset charset)
Unauthorizedback to summary
private Unauthorized(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.UnprocessableEntity

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 422 Unprocessable Entity.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
UnprocessableEntity(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
UnprocessableEntity(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

UnprocessableEntityback to summary
private UnprocessableEntity(String statusText, HttpHeaders headers, byte[] body, Charset charset)
UnprocessableEntityback to summary
private UnprocessableEntity(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)
org.springframework.web.client back to summary

public final Class HttpClientErrorException.UnsupportedMediaType

extends HttpClientErrorException
Class Inheritance
Annotations
@SuppressWarnings:serial

HttpClientErrorException for status HTTP 415 Unsupported Media Type.
Since
5.1

Constructor Summary

AccessConstructor and Description
private
UnsupportedMediaType(String statusText, HttpHeaders headers, byte[] body, Charset charset)

private
UnsupportedMediaType(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)

Method Summary

Inherited from org.springframework.web.client.HttpClientErrorException:
createcreate

Constructor Detail

UnsupportedMediaTypeback to summary
private UnsupportedMediaType(String statusText, HttpHeaders headers, byte[] body, Charset charset)
UnsupportedMediaTypeback to summary
private UnsupportedMediaType(String message, String statusText, HttpHeaders headers, byte[] body, Charset charset)