public class UnexpectedStatusException extends ProtocolException
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 |
|---|
UnexpectedStatusException(HttpStatus status)
Create a new
UnexpectedStatusException. |
UnexpectedStatusException(HttpStatus status,
java.lang.String message)
Create a new
UnexpectedStatusException with a message. |
| Modifier and Type | Method and Description |
|---|---|
HttpStatus |
status()
Returns the
HttpStatus as returned by the server. |
public UnexpectedStatusException(HttpStatus status)
UnexpectedStatusException.status - The HttpStatus returned by the server.public UnexpectedStatusException(HttpStatus status, java.lang.String message)
UnexpectedStatusException with a message.status - The HttpStatus returned by the server.message - An error message.public HttpStatus status()
HttpStatus as returned by the server.HttpStatus.