|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.spiffyui.client.rest.RESTException
public class RESTException
This exception represents a successful return from a REST call with an error payload. This exception parses the payload and returns all the parts of the exception.
This exception follows the SOAP fault format. The basic structure looks like this:
{ "Fault": { "Code": { "Value": "Sender", "Subcode": { "Value": "MessageTimeout" } }, "Reason": { "Text": "Sender Timeout" }, "Detail": { "MaxTime": "P5M" } } }
The fields in this class map to this JSON structure.
Field Summary | |
---|---|
static java.lang.String |
AUTH_SERVER_UNAVAILABLE
This constant indicates that the core server was not able to contact the authentication server. |
static java.lang.String |
INVALID_AUTH_HEADER
This constant indicates that the server returned a 401, but the required HTTP header was invalid |
static java.lang.String |
INVALID_RESPONSE
This is a constant error code to indicate the JSON returned from the server was parsable, but still invalid. |
static java.lang.String |
NO_AUTH_HEADER
This constant indicates that the server returned a 401, but did not return the required authentication HTTP header |
static java.lang.String |
NO_SERVER_RESPONSE
This constant indicates that we were unable to contact the server. |
static java.lang.String |
UNPARSABLE_RESPONSE
This is a constant error code to indicate the response was not well formed JSON |
static java.lang.String |
XSS_ERROR
This constant indicates that the server returned a 401, but did not return the required authentication HTTP header |
Constructor Summary | |
---|---|
RESTException(java.lang.String code,
java.lang.String subcode,
java.lang.String reason,
java.util.Map<java.lang.String,java.lang.String> details,
int responseCode,
java.lang.String url)
Creates a new RESTException |
Method Summary | |
---|---|
static RESTException |
generateInvalidJSONException(java.lang.String url)
Gets a generic exception representing invalid JSON |
java.lang.String |
getCode()
The code for the exception |
java.util.Map<java.lang.String,java.lang.String> |
getDetails()
The details for this exception |
java.lang.String |
getReason()
The reason for this exception |
int |
getResponseCode()
Gets the server response code that came with this error message |
java.lang.String |
getSubcode()
The subcode for this exception |
java.lang.String |
getUrl()
Gets the URL that was called when this RESTException was thrown |
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 java.lang.String UNPARSABLE_RESPONSE
public static final java.lang.String INVALID_RESPONSE
public static final java.lang.String NO_SERVER_RESPONSE
public static final java.lang.String NO_AUTH_HEADER
public static final java.lang.String INVALID_AUTH_HEADER
public static final java.lang.String XSS_ERROR
public static final java.lang.String AUTH_SERVER_UNAVAILABLE
Constructor Detail |
---|
public RESTException(java.lang.String code, java.lang.String subcode, java.lang.String reason, java.util.Map<java.lang.String,java.lang.String> details, int responseCode, java.lang.String url)
code
- the exception codesubcode
- the optional exception subcodereason
- the optional exception reasondetails
- the optional exception detailsresponseCode
- the HTTP response codeurl
- the URL for this exceptionMethod Detail |
---|
public java.lang.String getCode()
public java.lang.String getSubcode()
public java.lang.String getReason()
public java.util.Map<java.lang.String,java.lang.String> getDetails()
public int getResponseCode()
public java.lang.String getUrl()
public static RESTException generateInvalidJSONException(java.lang.String url)
url
- the URL where this bad JSON came from
public java.lang.String toString()
toString
in class java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |