public class ApiException
extends java.lang.Exception
Constructor and Description |
---|
ApiException()
Constructs an
ApiException with no detail message. |
ApiException(int status,
java.util.Map<? extends java.lang.String,? extends java.lang.Object> errorData)
Constructs an
ApiException with the specified details status
and error data. |
ApiException(java.lang.String s)
Constructs an
ApiException with the specified detail message. |
ApiException(java.lang.String s,
java.lang.Throwable cause)
Constructs an
ApiException with the specified detail message
and cause. |
ApiException(java.lang.Throwable cause)
Constructs an
ApiCommunicationException with the specified cause. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
describe()
Returns a string describing the exception.
|
java.lang.String |
getErrorCode()
Returns the error code for this exception.
|
java.util.Map<? extends java.lang.String,? extends java.lang.Object> |
getErrorData()
Returns the API error data for this exception.
|
java.lang.String |
getMessage()
Returns the string detail message for this exception.
|
java.lang.String |
getReference()
Returns the reference string for this exception.
|
int |
getStatus()
Returns the HTTP status code for this exception.
|
public ApiException()
ApiException
with no detail message.public ApiException(java.lang.String s)
ApiException
with the specified detail message.s
- the detail message.public ApiException(java.lang.String s, java.lang.Throwable cause)
ApiException
with the specified detail message
and cause.s
- the detail message.cause
- the detail message.public ApiException(java.lang.Throwable cause)
ApiCommunicationException
with the specified cause.cause
- the detail message.public ApiException(int status, java.util.Map<? extends java.lang.String,? extends java.lang.Object> errorData)
ApiException
with the specified details status
and error data.status
- the HTTP status codeerrorData
- a map representing the error details returned by the API. The map is
expected to contain String
value for the key "reference"
and
a map containing the detailed error data for the key "key"
. This map in turn
is expected to contain String
values for the keys
"code"
and "message"
.public java.util.Map<? extends java.lang.String,? extends java.lang.Object> getErrorData()
null
).public java.lang.String getReference()
null
).public java.lang.String getErrorCode()
null
).public int getStatus()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
null
).public java.lang.String describe()