com.ibm.streamsx.rest
Class RESTException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- com.ibm.streamsx.rest.RESTException
-
- All Implemented Interfaces:
- java.io.Serializable
public class RESTException extends java.io.IOException
Exception for REST api wrappers- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RESTException(int code, java.lang.String message)
Customized exception that can provide more information on REST errorsRESTException(int code)
Customized exception that can provide more information on REST errorsRESTException(java.lang.String message, java.lang.Exception exception)
Customized exception that can provide more information on REST errorsRESTException(java.lang.String message)
Customized exception that can provide more information on REST errors
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static RESTException
create(int code, java.lang.String streamsMessage)
Customized exception that can provide more information on REST errorsint
getStatusCode()
Gets the error status code for this exceptioncom.google.gson.JsonObject
getStreamsErrorMessageAsJson()
Gets the IBM Streams message for this exception as a Json Objectjava.lang.String
getStreamsErrorMessageId()
Gets the IBM Streams message ID for this exception
-
-
-
Constructor Detail
-
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
public RESTException(int code, java.lang.String message)
Customized exception that can provide more information on REST errors- Parameters:
code
- - error message codemessage
- - error message to be seen
-
RESTException
public RESTException(java.lang.String message)
Customized exception that can provide more information on REST errors- Parameters:
message
- - error message to be seen
-
RESTException
public RESTException(java.lang.String message, java.lang.Exception exception)
Customized exception that can provide more information on REST errors- Parameters:
message
- - error message to be seenexception
- - cause
-
-
Method Detail
-
create
public static final RESTException create(int code, java.lang.String streamsMessage)
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 IBM Streams Message
-
getStatusCode
public int getStatusCode()
Gets the error status code for this exception- Returns:
- the error status code
-
getStreamsErrorMessageId
public java.lang.String getStreamsErrorMessageId()
Gets the IBM Streams message ID for this exception- Returns:
- the IBM Streams message ID
-
getStreamsErrorMessageAsJson
public com.google.gson.JsonObject getStreamsErrorMessageAsJson()
Gets the IBM Streams message for this exception as a Json Object- Returns:
- the IBM Streams message as a
JsonObject
-
-