public class BoxAPIException extends RuntimeException
| Constructor and Description |
|---|
BoxAPIException(String message)
Constructs a BoxAPIException with a specified message.
|
BoxAPIException(String message,
int responseCode,
String response)
Constructs a BoxAPIException with details about the server's response.
|
BoxAPIException(String message,
int responseCode,
String responseBody,
Map<String,List<String>> responseHeaders)
Constructs a BoxAPIException with details about the server's response, including response headers.
|
BoxAPIException(String message,
int responseCode,
String responseBody,
Map<String,List<String>> responseHeaders,
Throwable cause)
Constructs a BoxAPIException that includes the response headers.
|
BoxAPIException(String message,
int responseCode,
String response,
Throwable cause)
Constructs a BoxAPIException that wraps another underlying exception with details about the server's response.
|
BoxAPIException(String message,
Throwable cause)
Constructs a BoxAPIException that wraps another underlying exception.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<String>> |
getHeaders()
Gets the response headers, if available.
|
String |
getResponse()
Gets the body of the response returned by the server when this exception was thrown.
|
int |
getResponseCode()
Gets the response code returned by the server when this exception was thrown.
|
protected void |
setHeaders(Map<String,List<String>> headers)
Sets the response headers.
|
protected void |
setResponse(String response)
Sets the response returned by ther server.
|
protected void |
setResponseCode(int responseCode)
Sets the response code returned by the server.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic BoxAPIException(String message)
message - a message explaining why the exception occurred.public BoxAPIException(String message, int responseCode, String response)
message - a message explaining why the exception occurred.responseCode - the response code returned by the Box server.response - the response body returned by the Box server.public BoxAPIException(String message, int responseCode, String responseBody, Map<String,List<String>> responseHeaders)
message - a message explaining why the exception occurred.responseCode - the response code returned by the Box server.responseBody - the response body returned by the Box server.responseHeaders - the response headers returned by the Box server.public BoxAPIException(String message, Throwable cause)
message - a message explaining why the exception occurred.cause - an underlying exception.public BoxAPIException(String message, int responseCode, String response, Throwable cause)
message - a message explaining why the exception occurred.responseCode - the response code returned by the Box server.response - the response body returned by the Box server.cause - an underlying exception.public BoxAPIException(String message, int responseCode, String responseBody, Map<String,List<String>> responseHeaders, Throwable cause)
message - a message explaining why the exception occurred.responseCode - the response code returned by the Box server.responseBody - the response body returned by the Box server.responseHeaders - the response headers returned by the Box server.cause - an underlying exception.public int getResponseCode()
protected void setResponseCode(int responseCode)
responseCode - the response code returned by the server.public String getResponse()
protected void setResponse(String response)
response - the response returned by the server.public Map<String,List<String>> getHeaders()
protected void setHeaders(Map<String,List<String>> headers)
headers - headers to set.