类 HttpServerErrorException
- 所有已实现的接口:
Serializable
public class HttpServerErrorException extends HttpStatusCodeException
Exception thrown when an HTTP 5xx is received.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma
- 另请参阅:
DefaultResponseErrorHandler
, 序列化表格
构造器概要
构造器 构造器 说明 HttpServerErrorException(HttpStatus statusCode)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
.HttpServerErrorException(HttpStatus statusCode, String statusText)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
and status text.HttpServerErrorException(HttpStatus statusCode, String statusText, byte[] responseBody, Charset responseCharset)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
, status text, and response body content.HttpServerErrorException(HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
, status text, and response body content.
方法概要
从类继承的方法 org.springframework.web.client.HttpStatusCodeException
getStatusCode
从类继承的方法 org.springframework.web.client.RestClientResponseException
getRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseHeaders, getStatusText
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
.- 参数:
statusCode
- the status code
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
and status text.- 参数:
statusCode
- the status codestatusText
- the status text
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText, byte[] responseBody, Charset responseCharset)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
, status text, and response body content.- 参数:
statusCode
- the status codestatusText
- the status textresponseBody
- the response body content (may benull
)responseCharset
- the response body charset (may benull
)- 从以下版本开始:
- 3.0.5
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
, status text, and response body content.- 参数:
statusCode
- the status codestatusText
- the status textresponseHeaders
- the response headers (may benull
)responseBody
- the response body content (may benull
)responseCharset
- the response body charset (may benull
)- 从以下版本开始:
- 3.1.2