public abstract class HttpStatusCodeException extends RestClientResponseException
HttpStatus
.Modifier | Constructor and Description |
---|---|
protected |
HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance with an
HttpStatus . |
protected |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText)
Construct a new instance with an
HttpStatus and status text. |
protected |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct instance with an
HttpStatus , status text, and content. |
protected |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders responseHeaders,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct instance with an
HttpStatus , status text, content, and
a response charset. |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
getStatusCode()
Return the HTTP status code.
|
getRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseHeaders, getStatusText
contains, getMessage, getMostSpecificCause, getRootCause
protected HttpStatusCodeException(HttpStatus statusCode)
HttpStatus
.statusCode
- the status codeprotected HttpStatusCodeException(HttpStatus statusCode, java.lang.String statusText)
HttpStatus
and status text.statusCode
- the status codestatusText
- the status textprotected HttpStatusCodeException(HttpStatus statusCode, java.lang.String statusText, @Nullable byte[] responseBody, @Nullable java.nio.charset.Charset responseCharset)
HttpStatus
, status text, and content.statusCode
- the status codestatusText
- the status textresponseBody
- the response body content, may be null
responseCharset
- the response body charset, may be null
protected HttpStatusCodeException(HttpStatus statusCode, java.lang.String statusText, @Nullable HttpHeaders responseHeaders, @Nullable byte[] responseBody, @Nullable java.nio.charset.Charset responseCharset)
HttpStatus
, status text, content, and
a response charset.statusCode
- the status codestatusText
- the status textresponseHeaders
- the response headers, may be null
responseBody
- the response body content, may be null
responseCharset
- the response body charset, may be null
public HttpStatus getStatusCode()