Class ServiceUsageException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.adobe.pdfservices.operation.exception.ServiceUsageException
-
- All Implemented Interfaces:
Serializable
public class ServiceUsageException extends RuntimeException
ServiceUsageException is thrown when either Service usage limit has been reached or credentials quota has been exhausted.- See Also:
SDKException
,ServiceApiException
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description String
DEFAULT_ERROR_CODE
the default value of error code if there is no error code for this service failure.int
DEFAULT_STATUS_CODE
the default value of status code if there is no status code for this service failure.
-
Constructor Summary
Constructors Constructor Description ServiceUsageException(String message)
Constructs aServiceUsageException
with the specified detail message.ServiceUsageException(String message, String requestTrackingId, int statusCode)
Constructs aServiceUsageException
with the specified detail message, requestId and returned HTTP status code.ServiceUsageException(String message, String requestTrackingId, int statusCode, String errorCode)
Constructs aServiceUsageException
with the specified detail message, requestId, returned HTTP status code and error code.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getErrorCode()
Returns the Error code orDEFAULT_ERROR_CODE
if the error code doesn't adequately represent the error.String
getMessage()
Returns the detailed message for this exception.String
getRequestTrackingId()
Returns the Request ID (the value of the X-Request-ID header).int
getStatusCode()
Returns the HTTP Status code orDEFAULT_STATUS_CODE
if the status code doesn't adequately represent the error.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
DEFAULT_STATUS_CODE
public final int DEFAULT_STATUS_CODE
the default value of status code if there is no status code for this service failure.- See Also:
- Constant Field Values
-
DEFAULT_ERROR_CODE
public final String DEFAULT_ERROR_CODE
the default value of error code if there is no error code for this service failure.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServiceUsageException
public ServiceUsageException(String message)
Constructs aServiceUsageException
with the specified detail message.- Parameters:
message
- exception detail message
-
ServiceUsageException
public ServiceUsageException(String message, String requestTrackingId, int statusCode)
Constructs aServiceUsageException
with the specified detail message, requestId and returned HTTP status code.- Parameters:
message
- exception detail messagerequestTrackingId
- X-Request-Id header value to track the requeststatusCode
- HTTP Status code returned in API response
-
ServiceUsageException
public ServiceUsageException(String message, String requestTrackingId, int statusCode, String errorCode)
Constructs aServiceUsageException
with the specified detail message, requestId, returned HTTP status code and error code.- Parameters:
message
- exception detail messagerequestTrackingId
- X-Request-Id header value to track the requeststatusCode
- HTTP Status code returned in API responseerrorCode
- Error code returned in API response
-
-
Method Detail
-
getMessage
public String getMessage()
Returns the detailed message for this exception.- Overrides:
getMessage
in classThrowable
- Returns:
- the detailed message
-
getRequestTrackingId
public String getRequestTrackingId()
Returns the Request ID (the value of the X-Request-ID header).- Returns:
- Request ID
-
getStatusCode
public int getStatusCode()
Returns the HTTP Status code orDEFAULT_STATUS_CODE
if the status code doesn't adequately represent the error.- Returns:
- the HTTP Status code or
DEFAULT_STATUS_CODE
if the status code doesn't adequately represent the error.
-
getErrorCode
public String getErrorCode()
Returns the Error code orDEFAULT_ERROR_CODE
if the error code doesn't adequately represent the error.- Returns:
- the Error code or
DEFAULT_ERROR_CODE
if the error code doesn't adequately represent the error.
-
-