Class UnknownHttpStatusCodeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.client.RestClientException
org.springframework.web.client.RestClientResponseException
org.springframework.web.client.UnknownHttpStatusCodeException
- All Implemented Interfaces:
- Serializable
Exception thrown when an unknown (or custom) HTTP status code is received.
- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionUnknownHttpStatusCodeException(int rawStatusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance ofHttpStatusCodeExceptionbased on a status code, status text, and response body content.UnknownHttpStatusCodeException(String message, int rawStatusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance ofHttpStatusCodeExceptionbased on a status code, status text, and response body content.
- 
Method SummaryMethods inherited from class RestClientResponseExceptiongetResponseBodyAs, getResponseBodyAs, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseBodyAsString, getResponseHeaders, getStatusCode, getStatusText, setBodyConvertFunctionMethods inherited from class NestedRuntimeExceptioncontains, getMostSpecificCause, getRootCauseMethods inherited from class ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
UnknownHttpStatusCodeExceptionpublic UnknownHttpStatusCodeException(int rawStatusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance ofHttpStatusCodeExceptionbased on a status code, status text, and response body content.- Parameters:
- rawStatusCode- the raw status code value
- statusText- the status text
- responseHeaders- the response headers (may be- null)
- responseBody- the response body content (may be- null)
- responseCharset- the response body charset (may be- null)
 
- 
UnknownHttpStatusCodeExceptionpublic UnknownHttpStatusCodeException(String message, int rawStatusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance ofHttpStatusCodeExceptionbased on a status code, status text, and response body content.- Parameters:
- rawStatusCode- the raw status code value
- statusText- the status text
- responseHeaders- the response headers (may be- null)
- responseBody- the response body content (may be- null)
- responseCharset- the response body charset (may be- null)
- Since:
- 5.2.2
 
 
-