public class RequestException
extends java.util.concurrent.ExecutionException
| Modifier and Type | Field and Description |
|---|---|
static int |
CODE_ACCEPTED
Request accepted but data is incomplete / invalid
|
static int |
CODE_BAD_REQUEST
The request was invalid.
|
static int |
CODE_FORBIDDEN
You don't have permission to complete the operation or access the resource.
|
static int |
CODE_INTERNAL_SERVER_ERROR
Something is wrong on our end.
|
static int |
CODE_METHOD_NOT_ALLOWED
The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
|
static int |
CODE_NOT_FOUND
You requested an invalid method.
|
static int |
CODE_SERVICE_UNAVAILABLE
The method you requested is currently unavailable (due to maintenance or high load).
|
static int |
CODE_TIMEOUT
The server timed out waiting for the request.
|
static int |
CODE_TOO_MANY_REQUESTS
You have exceeded the rate limit.
|
static int |
CODE_UNAUTHORIZED
The authentication you provided is invalid.
|
static int |
INTERRUPTED
Waiting thread is activated before the condition it was waiting for has been satisfied.
|
protected com.humandevice.resttools.rest.exceptions.RequestException.ErrorResponse |
mErrorResponse |
static int |
TIMEOUT
Blocking operation times out
|
static int |
UNKNOWN
Non server exception
|
| Constructor and Description |
|---|
RequestException(java.lang.Exception e) |
RequestException(java.lang.String errorJson,
int requestCode)
Konstruktor wyjątku parsujący odpowiedź z serwera
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCode()
Kod błędu
|
java.util.Map<java.lang.String,java.lang.String[]> |
getErrors()
błędy w formularzu
|
java.lang.String |
getMessage()
Wiadomość błędu
|
int |
getStatusCode()
Kod odpowiedzi
|
boolean |
isConnectionError()
Metoda sprawdzająca czy exception został wywołany na etapie połączenia z serwerem
|
boolean |
isResponseError()
Metoda sprawdzająca czy exception został wywołany na serwerze i został zwrócony json błędu
|
public static final int CODE_ACCEPTED
public static final int CODE_BAD_REQUEST
public static final int CODE_UNAUTHORIZED
public static final int CODE_FORBIDDEN
public static final int CODE_NOT_FOUND
public static final int CODE_METHOD_NOT_ALLOWED
public static final int CODE_TIMEOUT
public static final int CODE_TOO_MANY_REQUESTS
public static final int CODE_INTERNAL_SERVER_ERROR
public static final int CODE_SERVICE_UNAVAILABLE
public static final int UNKNOWN
public static final int INTERRUPTED
public static final int TIMEOUT
protected com.humandevice.resttools.rest.exceptions.RequestException.ErrorResponse mErrorResponse
public RequestException(java.lang.Exception e)
public RequestException(java.lang.String errorJson,
int requestCode)
throws java.io.IOException
errorJson - requestCode - java.io.IOExceptionpublic boolean isConnectionError()
public boolean isResponseError()
public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic int getCode()
public int getStatusCode()
public java.util.Map<java.lang.String,java.lang.String[]> getErrors()