Package com.castlabs.android.drm
Class DrmTodayException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.castlabs.android.drm.DrmTodayException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- DrmException
Use this Exception class to report any errors from DrmToday services. The exception
 is initialized with an error code which is one of: 
ERROR_NOT_AUTHORIZED,
 ERROR_INVALID_REQUEST, ERROR_KEY_NOT_FOUND, ERROR_PROVISIONING_FAILED,
 ERROR_TOO_MANY_CONCURRENT_SESSIONS, or ERROR_UNKNOWN.- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intA device time error occurredstatic final intError indicating an invalid request that was rejected by the serverstatic final intError indicating that an IO error occurred during the license request.static final intError indicating that the requested content was not foundstatic final intError indicating an unauthorized requeststatic final intError indicating that the provisioning request failed.static final intError raised when DRMtoday refuses license renewal due to too many open sessionsstatic final intError indicating a general errorstatic final intA device's Widevine certificate was revoked
- 
Constructor SummaryConstructorsConstructorDescriptionDrmTodayException(String message, int errorCode) Create a new instance with the given message and error errorCodeDrmTodayException(String message, int errorCode, String customMessage) Create a new instance with the given message and error errorCodeDrmTodayException(String message, int errorCode, String customMessage, String customCode, Throwable cause) DrmTodayException(String message, int errorCode, Throwable cause) Create a new instance with the given message and error errorCode
- 
Method SummaryModifier and TypeMethodDescriptionstatic DrmTodayExceptioncreate(DrmUtils.HttpExecutorException httpException) Looks at the response code, the response body, and the headers and returns a DRMtoday Exception that maps to the given error.inttoString()Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
- 
Field Details- 
ERROR_UNKNOWNpublic static final int ERROR_UNKNOWNError indicating a general error- See Also:
 
- 
ERROR_INVALID_REQUESTpublic static final int ERROR_INVALID_REQUESTError indicating an invalid request that was rejected by the server- See Also:
 
- 
ERROR_NOT_AUTHORIZEDpublic static final int ERROR_NOT_AUTHORIZEDError indicating an unauthorized request- See Also:
 
- 
ERROR_KEY_NOT_FOUNDpublic static final int ERROR_KEY_NOT_FOUNDError indicating that the requested content was not found- See Also:
 
- 
ERROR_IO_ERRORpublic static final int ERROR_IO_ERRORError indicating that an IO error occurred during the license request. This cause of this exception will be anIOException- See Also:
 
- 
ERROR_PROVISIONING_FAILEDpublic static final int ERROR_PROVISIONING_FAILEDError indicating that the provisioning request failed. Error of this type can also have anIOExceptionas cause.- See Also:
 
- 
ERROR_TOO_MANY_CONCURRENT_SESSIONSpublic static final int ERROR_TOO_MANY_CONCURRENT_SESSIONSError raised when DRMtoday refuses license renewal due to too many open sessions- See Also:
 
- 
ERROR_DEVICE_TIMEpublic static final int ERROR_DEVICE_TIMEA device time error occurred- See Also:
 
- 
ERROR_WIDEVINE_DEV_CERTIFICATE_REVOKEDpublic static final int ERROR_WIDEVINE_DEV_CERTIFICATE_REVOKEDA device's Widevine certificate was revoked- See Also:
 
 
- 
- 
Constructor Details- 
DrmTodayExceptionCreate a new instance with the given message and error errorCode- Parameters:
- message- the error message
- errorCode- the error errorCode
 
- 
DrmTodayExceptionCreate a new instance with the given message and error errorCode- Parameters:
- message- the error message
- errorCode- the error errorCode
- customMessage- the custom message
 
- 
DrmTodayExceptionCreate a new instance with the given message and error errorCode- Parameters:
- message- the error message
- errorCode- the error errorCode
- cause- the cause
 
- 
DrmTodayException
 
- 
- 
Method Details- 
getErrorCodepublic int getErrorCode()- Returns:
- The error code. One of ERROR_NOT_AUTHORIZED,ERROR_INVALID_REQUEST,ERROR_UNKNOWN,ERROR_TOO_MANY_CONCURRENT_SESSIONS, orERROR_KEY_NOT_FOUND
 
- 
getCustomMessage- Returns:
- The custom CRT error message or null
 
- 
getCustomCode- Returns:
- DrmToday response code string
 
- 
toString
- 
create@NonNull public static DrmTodayException create(@NonNull DrmUtils.HttpExecutorException httpException) Looks at the response code, the response body, and the headers and returns a DRMtoday Exception that maps to the given error.- Parameters:
- httpException- The HTTP exception
- Returns:
- The DrmTodayException
 
 
-