Class RESTException

All Implemented Interfaces:
Serializable

public class RESTException extends IOException
Exception for REST api wrappers
See Also:
  • 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

      public RESTException(int code, String message)
      Customized exception that can provide more information on REST errors
      Parameters:
      code - - error message code
      message - - error message to be seen
    • RESTException

      public RESTException(String message)
      Customized exception that can provide more information on REST errors
      Parameters:
      message - - error message to be seen
    • RESTException

      public RESTException(String message, Exception exception)
      Customized exception that can provide more information on REST errors
      Parameters:
      message - - error message to be seen
      exception - - cause
  • Method Details

    • create

      public static final RESTException create(int code, 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 Streams Message
    • getStatusCode

      public int getStatusCode()
      Gets the error status code for this exception
      Returns:
      the error status code
    • getStreamsErrorMessageId

      public String 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