Package com.teracloud.streams.rest
Class RESTException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.teracloud.streams.rest.RESTException
- All Implemented Interfaces:
Serializable
Exception for REST api wrappers
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRESTException
(int code) Customized exception that can provide more information on REST errorsRESTException
(int code, String message) Customized exception that can provide more information on REST errorsRESTException
(String message) Customized exception that can provide more information on REST errorsRESTException
(String message, Exception exception) Customized exception that can provide more information on REST errors -
Method Summary
Modifier and TypeMethodDescriptionstatic final RESTException
Customized exception that can provide more information on REST errorsint
Gets the error status code for this exceptioncom.google.gson.JsonObject
Gets the Streams message for this exception as a Json ObjectGets the Streams message ID for this exceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RESTException
public RESTException(int code) Customized exception that can provide more information on REST errors- Parameters:
code
- - error message code (currently will contain only HTTP response codes)
-
RESTException
Customized exception that can provide more information on REST errors- Parameters:
code
- - error message codemessage
- - error message to be seen
-
RESTException
Customized exception that can provide more information on REST errors- Parameters:
message
- - error message to be seen
-
RESTException
Customized exception that can provide more information on REST errors- Parameters:
message
- - error message to be seenexception
- - cause
-
-
Method Details
-
create
Customized exception that can provide more information on REST errors- Parameters:
code
- - error message code (matches HTTP response codes)- Returns:
- a
RESTException
created from a code and an Streams Message
-
getStatusCode
public int getStatusCode()Gets the error status code for this exception- Returns:
- the error status code
-
getStreamsErrorMessageId
Gets the Streams message ID for this exception- Returns:
- the Streams message ID
-
getStreamsErrorMessageAsJson
public com.google.gson.JsonObject getStreamsErrorMessageAsJson()Gets the Streams message for this exception as a Json Object- Returns:
- the Streams message as a
JsonObject
-