public final class HttpException
extends java.io.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(java.lang.String message)
Deprecated.
You should always include a status code, default to
UNKNOWN if you can't
come up with a reasonable one. This method will be removed in a future version. |
HttpException(java.lang.String message,
int statusCode) |
HttpException(java.lang.String message,
int statusCode,
java.lang.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. |
public static final int UNKNOWN
public HttpException(int statusCode)
@Deprecated public HttpException(java.lang.String message)
UNKNOWN
if you can't
come up with a reasonable one. This method will be removed in a future version.public HttpException(java.lang.String message, int statusCode)
public HttpException(java.lang.String message, int statusCode, @Nullable java.lang.Throwable cause)
public int getStatusCode()
UNKNOWN
if the request failed without providing a
status code.