public class UnexpectedResponseException extends ProtocolException
HttpResponseHandler.
There are three major subclasses: RedirectionException for 3xx response status codes, ClientErrorException for 4xx
response status codes and ServerErrorException for 5xx response status codes, some of them having subclasses themselves. Implementations
should always pick the most appropriate error class to allow for proper exception handling.
| Constructor and Description |
|---|
UnexpectedResponseException(HttpStatus status)
Create a new
UnexpectedResponseException. |
UnexpectedResponseException(HttpStatus status,
java.lang.String message)
Create a new
UnexpectedResponseException with a message. |
| Modifier and Type | Method and Description |
|---|---|
HttpStatus |
status()
Returns the status code as returned by the server.
|
public UnexpectedResponseException(HttpStatus status)
UnexpectedResponseException.status - The status returned by the server.public UnexpectedResponseException(HttpStatus status, java.lang.String message)
UnexpectedResponseException with a message.status - The status returned by the server.message - An error message.public HttpStatus status()