-
- All Implemented Interfaces:
-
java.io.Serializable
public final class HttpException extends IOException
Thrown when an http request fails.
Exposes the specific status code or UNKNOWN via getStatusCode so users may attempt to retry or otherwise uniformly handle certain types of errors regardless of the underlying http library.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intUNKNOWNprivate final intstatusCode
-
Constructor Summary
Constructors Constructor Description HttpException(int statusCode)HttpException(String message)HttpException(String message, int statusCode)HttpException(String message, int statusCode, Throwable cause)
-
Method Summary
Modifier and Type Method Description intgetStatusCode()Returns the http status code, or UNKNOWN if the request failed without providing astatus code. -
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getStatusCode
int getStatusCode()
Returns the http status code, or UNKNOWN if the request failed without providing astatus code.
-
-
-
-