Package org.springframework.web.client
Class HttpServerErrorException
- All Implemented Interfaces:
Serializable
public class HttpServerErrorException extends HttpStatusCodeException
Exception thrown when an HTTP 5xx is received.- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
DefaultResponseErrorHandler
, Serialized Form
Constructor Summary
Constructors Constructor Description 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.
Method Summary
Methods inherited from class org.springframework.web.client.HttpStatusCodeException
getStatusCode
Methods inherited from class org.springframework.web.client.RestClientResponseException
getRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseHeaders, getStatusText
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
.- Parameters:
statusCode
- the status code
HttpServerErrorException
public HttpServerErrorException(HttpStatus statusCode, String statusText)
Construct a new instance ofHttpServerErrorException
based on anHttpStatus
and status text.- Parameters:
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.- Parameters:
statusCode
- the status codestatusText
- the status textresponseBody
- the response body content (may benull
)responseCharset
- the response body charset (may benull
)- Since:
- 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.- Parameters:
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
)- Since:
- 3.1.2