Class ContentException

All Implemented Interfaces:
Serializable

public class ContentException extends RuntimeException implements Serializable
Encapsulates the various error conditions and contained exceptions that can occur when making SDK calls.
See Also:
  • Constructor Details

    • ContentException

      public ContentException(ContentException.REASON reason, Throwable cause, String logMessage, ContentError contentError, int responseCode)
      Initializes a newly created ContentException with the specified message and caused by the specified Throwable
      Parameters:
      reason - The ContentException.REASON as set by the SDK
      cause - The cause of the ContentException, may by null
      logMessage - The message to add to the exception for logging purposes
      contentError - content error if applicable
      responseCode - http response code if applicable
    • ContentException

      public ContentException(ContentException.REASON reason, String logMessage)
      Create a ContentException with just REASON and log message.
      Parameters:
      reason - The ContentException.REASON as set by the SDK
      logMessage - The message to add to the exception for logging purposes
    • ContentException

      public ContentException(ContentException.REASON reason, String logMessage, Throwable cause)
      Create a ContentException with just REASON, cause and log message.
      Parameters:
      reason - The ContentException.REASON as set by the SDK
      logMessage - The message to add to the exception for logging purposes
      cause - The underlying cause
  • Method Details

    • getLogMessage

      public String getLogMessage()
      Returns the log message of the exception as set internally by the SDK.
      Returns:
      The exception's message
    • getReason

      public ContentException.REASON getReason()
      Get the reason for the exception as set by the SDK.
      Returns:
      REASON for the exception
    • getDetail

      public String getDetail()
      Get detail from ContentError or "" if not available
      Returns:
      Error detail string or empty string
    • getResponseCode

      public int getResponseCode()
      If there was a response from the server this value will be set (e.g. 404, 401). If the exception is not in the context of a response the value will be 0.
      Returns:
      http response code (or 0 if not applicable)
    • getContentError

      public ContentError getContentError()
      Get detailed ContentError response that came back from the server.
      Returns:
      if applicable, the ContentError from the server
    • getVerboseErrorMessage

      public String getVerboseErrorMessage()
      Generate a verbose debug message describing the error. This is meant for debugging purposes and not as a message that would be displayed to the user.
      Returns:
      verbose debug message describing the problem