|
SMILA 1.0 API documentation | ||||||||
| 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.eclipse.smila.utils.MaybeRecoverableException
org.eclipse.smila.http.client.RestException
public class RestException
Exception thrown by DefaultRestClient to wrap JSON errors returned by the REST API. The HTTP status code can
be read from the exception. If the request returns a JSON error object, it will be contained in the exception. If
the object has a key "message", the value will be the message of this exception. For status codes equal to or greater
than 500 (INTERNAL SERVER ERROR) the exception will be flagged as MaybeRecoverableException.isRecoverable() because such status codes
often describe only temporary issues and it is possible that a retry of the request will succeed.
| Constructor Summary | |
|---|---|
RestException(int responseCode,
AnyMap responseObject)
Create instance from response object. |
|
RestException(int responseCode,
java.lang.String message)
Create an instance with a message when no response object is available. |
|
| Method Summary | |
|---|---|
int |
getResponseCode()
Get the HTTP response code of the failed request. |
AnyMap |
getResponseObject()
Get the original JSON object of the response. |
| Methods inherited from class org.eclipse.smila.utils.MaybeRecoverableException |
|---|
isRecoverable, isRecoverableCause |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RestException(int responseCode,
java.lang.String message)
public RestException(int responseCode,
AnyMap responseObject)
| Method Detail |
|---|
public int getResponseCode()
HttpStatus for possible values.
public AnyMap getResponseObject()
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||