|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
com.dropbox.client2.exception.DropboxException
com.dropbox.client2.exception.DropboxServerException
public class DropboxServerException
Wraps any non-200 HTTP responses from an API call. See the constants in this class for the meaning of each error code. You'll typically only want to handle a few specific error codes and show some kind of generic error or retry for the rest.
Nested Class Summary | |
---|---|
static class |
DropboxServerException.Error
|
Field Summary | |
---|---|
static int |
_200_OK
The request was successful. |
static int |
_206_PARTIAL_CONTENT
The request was successful for a Range request. |
static int |
_302_FOUND
Moved to a new location temporarily. |
static int |
_304_NOT_MODIFIED
Contents have not changed (from the given hash, revision, ETag, or similar parameter). |
static int |
_400_BAD_REQUEST
Bad input parameter. |
static int |
_401_UNAUTHORIZED
Bad or expired access token. |
static int |
_403_FORBIDDEN
Usually from an invalid app key pair or other permanent error. |
static int |
_404_NOT_FOUND
Path not found. |
static int |
_405_METHOD_NOT_ALLOWED
Request method not allowed. |
static int |
_406_NOT_ACCEPTABLE
Too many metadata entries to return. |
static int |
_409_CONFLICT
|
static int |
_411_LENGTH_REQUIRED
Typically from trying to upload over HTTP using chunked encoding. |
static int |
_415_UNSUPPORTED_MEDIA
When a thumbnail cannot be created for the input file. |
static int |
_500_INTERNAL_SERVER_ERROR
Internal server error. |
static int |
_501_NOT_IMPLEMENTED
Not implemented. |
static int |
_502_BAD_GATEWAY
If a Dropbox server is down - try again later. |
static int |
_503_SERVICE_UNAVAILABLE
If a Dropbox server is not working properly - try again later. |
static int |
_507_INSUFFICIENT_STORAGE
User is over quota. |
DropboxServerException.Error |
body
The body, if any, of the returned error. |
int |
error
The HTTP error code. |
java.lang.String |
location
The location string from the headers (to handle redirects). |
java.util.Map<java.lang.String,java.lang.Object> |
parsedResponse
|
java.lang.String |
reason
The reason string associated with the error. |
java.lang.String |
server
The server string from the headers. |
Constructor Summary | |
---|---|
DropboxServerException(org.apache.http.HttpResponse response)
Creates a DropboxServerException from an HttpResponse . |
|
DropboxServerException(org.apache.http.HttpResponse response,
java.lang.Object rest)
Creates a DropboxServerException from an HttpResponse . |
Method Summary | |
---|---|
boolean |
isDuplicateAccount()
When this exception comes from creating a new account, returns whether the request failed because an account with the email address already exists. |
static boolean |
isValidWithNullBody(org.apache.http.HttpResponse response)
Whether the given response is valid when it has no body (only some error codes are allowed without a reason, currently 302 and 304). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int _200_OK
public static final int _206_PARTIAL_CONTENT
public static final int _302_FOUND
public static final int _304_NOT_MODIFIED
public static final int _400_BAD_REQUEST
public static final int _401_UNAUTHORIZED
public static final int _403_FORBIDDEN
public static final int _404_NOT_FOUND
public static final int _405_METHOD_NOT_ALLOWED
public static final int _406_NOT_ACCEPTABLE
public static final int _409_CONFLICT
public static final int _411_LENGTH_REQUIRED
public static final int _415_UNSUPPORTED_MEDIA
public static final int _500_INTERNAL_SERVER_ERROR
public static final int _501_NOT_IMPLEMENTED
public static final int _502_BAD_GATEWAY
public static final int _503_SERVICE_UNAVAILABLE
public static final int _507_INSUFFICIENT_STORAGE
public DropboxServerException.Error body
public int error
public java.lang.String reason
public java.lang.String server
public java.lang.String location
public java.util.Map<java.lang.String,java.lang.Object> parsedResponse
Constructor Detail |
---|
public DropboxServerException(org.apache.http.HttpResponse response)
DropboxServerException
from an HttpResponse
.
public DropboxServerException(org.apache.http.HttpResponse response, java.lang.Object rest)
DropboxServerException
from an HttpResponse
.
The rest parameter must be a Map of String to Object.
Method Detail |
---|
public boolean isDuplicateAccount()
public java.lang.String toString()
toString
in class java.lang.Throwable
public static boolean isValidWithNullBody(org.apache.http.HttpResponse response)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |