Package com.oracle.content.sdk
Class ContentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.oracle.content.sdk.ContentException
- All Implemented Interfaces:
Serializable
Encapsulates the various error conditions and contained exceptions that can occur when
making SDK calls.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Various reasons the exception may have occurred -
Constructor Summary
ConstructorsConstructorDescriptionContentException
(ContentException.REASON reason, String logMessage) Create a ContentException with just REASON and log message.ContentException
(ContentException.REASON reason, String logMessage, Throwable cause) Create a ContentException with just REASON, cause and log message.ContentException
(ContentException.REASON reason, Throwable cause, String logMessage, ContentError contentError, int responseCode) Initializes a newly createdContentException
with the specified message and caused by the specifiedThrowable
-
Method Summary
Modifier and TypeMethodDescriptionGet detailed ContentError response that came back from the server.Get detail from ContentError or "" if not availableReturns the log message of the exception as set internally by the SDK.Get the reason for the exception as set by the SDK.int
If there was a response from the server this value will be set (e.g.Generate a verbose debug message describing the error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ContentException
public ContentException(ContentException.REASON reason, Throwable cause, String logMessage, ContentError contentError, int responseCode) Initializes a newly createdContentException
with the specified message and caused by the specifiedThrowable
- Parameters:
reason
- TheContentException.REASON
as set by the SDKcause
- The cause of theContentException
, may by nulllogMessage
- The message to add to the exception for logging purposescontentError
- content error if applicableresponseCode
- http response code if applicable
-
ContentException
Create a ContentException with just REASON and log message.- Parameters:
reason
- TheContentException.REASON
as set by the SDKlogMessage
- The message to add to the exception for logging purposes
-
ContentException
Create a ContentException with just REASON, cause and log message.- Parameters:
reason
- TheContentException.REASON
as set by the SDKlogMessage
- The message to add to the exception for logging purposescause
- The underlying cause
-
-
Method Details
-
getLogMessage
Returns the log message of the exception as set internally by the SDK.- Returns:
- The exception's message
-
getReason
Get the reason for the exception as set by the SDK.- Returns:
- REASON for the exception
-
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
Get detailed ContentError response that came back from the server.- Returns:
- if applicable, the
ContentError
from the server
-
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
-