类 HttpServerErrorException
- 所有已实现的接口:
Serializable
- 直接已知子类:
HttpServerErrorException.BadGateway
,HttpServerErrorException.GatewayTimeout
,HttpServerErrorException.InternalServerError
,HttpServerErrorException.NotImplemented
,HttpServerErrorException.ServiceUnavailable
public class HttpServerErrorException extends HttpStatusCodeException
Exception thrown when an HTTP 5xx is received.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma
- 另请参阅:
DefaultResponseErrorHandler
, 序列化表格
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
HttpServerErrorException.BadGateway
HttpServerErrorException
for status HTTP HTTP 502 Bad Gateway.static class
HttpServerErrorException.GatewayTimeout
HttpServerErrorException
for status HTTP 504 Gateway Timeout.static class
HttpServerErrorException.InternalServerError
HttpServerErrorException
for status HTTP 500 Internal Server Error.static class
HttpServerErrorException.NotImplemented
HttpServerErrorException
for status HTTP 501 Not Implemented.static class
HttpServerErrorException.ServiceUnavailable
HttpServerErrorException
for status HTTP 503 Service Unavailable.
构造器概要
构造器 构造器 说明 HttpServerErrorException(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)
Constructor with a status code and status text, headers, content, and an prepared message.HttpServerErrorException(HttpStatus statusCode)
Constructor with a status code only.HttpServerErrorException(HttpStatus statusCode, String statusText)
Constructor with a status code and status text.HttpServerErrorException(HttpStatus statusCode, String statusText, byte[] body, Charset charset)
Constructor with a status code and status text, and content.HttpServerErrorException(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)
Constructor with a status code and status text, headers, and content.
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static HttpServerErrorException
create(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)
Variant ofcreate(String, HttpStatus, String, HttpHeaders, byte[], Charset)
with an optional prepared message.static HttpServerErrorException
create(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)
Create anHttpServerErrorException
or an HTTP status specific sub-class.从类继承的方法 org.springframework.web.client.HttpStatusCodeException
getStatusCode
从类继承的方法 org.springframework.web.client.RestClientResponseException
getRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseBodyAsString, getResponseHeaders, getStatusText
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode)
Constructor with a status code only.
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText)
Constructor with a status code and status text.
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText, @Nullable byte[] body, @Nullable Charset charset)
Constructor with a status code and status text, and content.
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable Charset charset)
Constructor with a status code and status text, headers, and content.
HttpServerErrorException
public HttpServerErrorException(String message, HttpStatus statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable Charset charset)
Constructor with a status code and status text, headers, content, and an prepared message.- 从以下版本开始:
- 5.2.2
方法详细资料
create
public static HttpServerErrorException create(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset)
Create anHttpServerErrorException
or an HTTP status specific sub-class.- 从以下版本开始:
- 5.1
create
public static HttpServerErrorException create(@Nullable String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset)
Variant ofcreate(String, HttpStatus, String, HttpHeaders, byte[], Charset)
with an optional prepared message.- 从以下版本开始:
- 5.2.2.