public class InvalidRequestException extends ApiException
ApiException
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
InvalidRequestException.FieldError
Class representing a single error on a field in a request sent to the API.
|
Constructor and Description |
---|
InvalidRequestException()
Constructs an
InvalidRequestException with no detail message. |
InvalidRequestException(int status,
java.util.Map<? extends java.lang.String,? extends java.lang.Object> errorData)
Constructs an
InvalidRequestException with the specified status
and error data. |
InvalidRequestException(java.lang.String s)
Constructs an
InvalidRequestException with the specified detail message. |
InvalidRequestException(java.lang.String s,
java.lang.Throwable cause)
Constructs an
InvalidRequestException with the specified detail message
and cause. |
InvalidRequestException(java.lang.Throwable cause)
Constructs an
InvalidRequestException with the specified cause. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
describe()
Returns a string describing the exception.
|
java.util.List<InvalidRequestException.FieldError> |
getFieldErrors()
Returns the list of field errors for this exception.
|
boolean |
hasFieldErrors()
Returns a boolean indicating if this exception contains field errors.
|
getErrorCode, getErrorData, getMessage, getReference, getStatus
public InvalidRequestException()
InvalidRequestException
with no detail message.public InvalidRequestException(java.lang.String s)
InvalidRequestException
with the specified detail message.s
- the detail message.public InvalidRequestException(java.lang.String s, java.lang.Throwable cause)
InvalidRequestException
with the specified detail message
and cause.s
- the detail message.cause
- the detail message.public InvalidRequestException(java.lang.Throwable cause)
InvalidRequestException
with the specified cause.cause
- the detail message.public InvalidRequestException(int status, java.util.Map<? extends java.lang.String,? extends java.lang.Object> errorData)
InvalidRequestException
with the specified 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"
and a list for the key "fieldErrors"
with each entry containing error information for a particular field.ApiException
,
InvalidRequestException.FieldError
public boolean hasFieldErrors()
public java.util.List<InvalidRequestException.FieldError> getFieldErrors()
FieldError
objects (may be empty).InvalidRequestException.FieldError
public java.lang.String describe()
describe
in class ApiException