Class UnexpectedStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.dmfs.httpessentials.exceptions.ProtocolException
org.dmfs.httpessentials.exceptions.UnexpectedStatusException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClientErrorException,RedirectionException,ServerErrorException
An exception that's thrown when a response status code was unexpected.
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUnexpectedStatusException(HttpStatus status) Create a newUnexpectedStatusException.UnexpectedStatusException(HttpStatus status, String message) Create a newUnexpectedStatusExceptionwith a message. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UnexpectedStatusException
Create a newUnexpectedStatusException.- Parameters:
status- TheHttpStatusreturned by the server.
-
UnexpectedStatusException
Create a newUnexpectedStatusExceptionwith a message.- Parameters:
status- TheHttpStatusreturned by the server.message- An error message.
-
-
Method Details
-
status
Returns theHttpStatusas returned by the server.- Returns:
- The
HttpStatus.
-