public class OneDriveServiceException extends ClientException
| Modifier and Type | Field and Description |
|---|---|
static int |
INDENT_SPACES
The intent spacing on json based responses.
|
static int |
INTERNAL_SERVER_ERROR
The internal server error threshold defined by http protocol.
|
protected static int |
MAX_BREVITY_LENGTH
The maximum length for a single line string when trying to be brief.
|
protected static int |
MAX_BYTE_COUNT_BEFORE_TRUNCATION
The number of bytes to display when showing byte array.
|
protected static char |
NEW_LINE
New line delimiter.
|
protected static java.lang.String |
TRUNCATION_MARKER
How truncated values are shown.
|
protected static java.lang.String |
X_THROWSITE
The throwsite header identifier
|
| Modifier | Constructor and Description |
|---|---|
protected |
OneDriveServiceException(java.lang.String method,
java.lang.String url,
java.util.List<java.lang.String> requestHeaders,
java.lang.String requestBody,
int responseCode,
java.lang.String responseMessage,
java.util.List<java.lang.String> responseHeaders,
OneDriveErrorResponse error)
Create a OneDrive service exception.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> OneDriveServiceException |
createFromConnection(IHttpRequest request,
T serializable,
ISerializer serializer,
IConnection connection)
Creates a OneDrive service exception from a given failed http request.
|
java.lang.String |
getMessage() |
java.lang.String |
getMessage(boolean verbose)
Gets the message for this exception.
|
java.util.List<java.lang.String> |
getResponseHeaders()
The response headers.
|
OneDriveError |
getServiceError()
Gets the error message from the OneDrive service object.
|
boolean |
isError(OneDriveErrorCodes expectedCode)
Determines if the given error code is expected.
|
protected static final char NEW_LINE
protected static final java.lang.String TRUNCATION_MARKER
protected static final int MAX_BREVITY_LENGTH
protected static final int MAX_BYTE_COUNT_BEFORE_TRUNCATION
public static final int INDENT_SPACES
public static final int INTERNAL_SERVER_ERROR
protected static final java.lang.String X_THROWSITE
protected OneDriveServiceException(java.lang.String method,
java.lang.String url,
java.util.List<java.lang.String> requestHeaders,
java.lang.String requestBody,
int responseCode,
java.lang.String responseMessage,
java.util.List<java.lang.String> responseHeaders,
OneDriveErrorResponse error)
method - The method that caused the exception.url - The url.requestHeaders - The request headers.requestBody - The request body.responseCode - The response code.responseMessage - The response message.responseHeaders - The response headers.error - The error response if available.public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.util.List<java.lang.String> getResponseHeaders()
public java.lang.String getMessage(boolean verbose)
verbose - If the message should be brief or more verbose.public OneDriveError getServiceError()
public boolean isError(OneDriveErrorCodes expectedCode)
ClientExceptionisError in class ClientExceptionexpectedCode - The expected error code.public static <T> OneDriveServiceException createFromConnection(IHttpRequest request, T serializable, ISerializer serializer, IConnection connection) throws java.io.IOException
T - The type of the serializable object.request - The request that resulted in this failure.serializable - The serialized object that was sent with this request.serializer - The serializer to re-create the option in its over the wire state.connection - The connection that was used to extract the response information from.java.io.IOException - An exception occurs if there were any problems processing the connection.