public final class HttpException extends IOException
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.
Modifier and Type | Field and Description |
---|---|
static int |
UNKNOWN |
Constructor and Description |
---|
HttpException(int statusCode) |
HttpException(String message) |
HttpException(String message,
int statusCode) |
HttpException(String message,
int statusCode,
Throwable cause) |
Modifier and Type | Method and Description |
---|---|
int |
getStatusCode()
Returns the http status code, or
UNKNOWN if the request failed without providing
a status code. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int UNKNOWN
public HttpException(int statusCode)
public HttpException(String message)
public HttpException(String message, int statusCode)
public int getStatusCode()
UNKNOWN
if the request failed without providing
a status code.