Class ServiceApiException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.adobe.pdfservices.operation.exception.ServiceApiException
-
- All Implemented Interfaces:
Serializable
public class ServiceApiException extends Exception
ServiceApiException is thrown when an underlying service API call results in an error.- See Also:
SDKException,ServiceUsageException, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description StringDEFAULT_ERROR_CODEthe default value of error code if there is no error code for this service failure.intDEFAULT_STATUS_CODEthe default value of status code if there is no status code for this service failure.
-
Constructor Summary
Constructors Constructor Description ServiceApiException(String message)Constructs aServiceApiExceptionwith the specified detail message.ServiceApiException(String message, String requestTrackingId, int statusCode)Constructs aServiceApiExceptionwith the specified detail message, requestId and returned HTTP status code.ServiceApiException(String message, String requestTrackingId, int statusCode, String errorCode)Constructs aServiceApiExceptionwith 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 StringgetErrorCode()Returns the Error code orDEFAULT_ERROR_CODEif the error code doesn't adequately represent the error.StringgetMessage()Returns the detail message of this exception.StringgetRequestTrackingId()Returns the Request ID (the value of the X-Request-ID header).intgetStatusCode()Returns the HTTP Status code orDEFAULT_STATUS_CODEif 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
-
ServiceApiException
public ServiceApiException(String message)
Constructs aServiceApiExceptionwith the specified detail message.- Parameters:
message- exception detail message
-
ServiceApiException
public ServiceApiException(String message, String requestTrackingId, int statusCode)
Constructs aServiceApiExceptionwith 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
-
ServiceApiException
public ServiceApiException(String message, String requestTrackingId, int statusCode, String errorCode)
Constructs aServiceApiExceptionwith 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
-
getStatusCode
public int getStatusCode()
Returns the HTTP Status code orDEFAULT_STATUS_CODEif the status code doesn't adequately represent the error.- Returns:
- the HTTP Status code or
DEFAULT_STATUS_CODEif the status code doesn't adequately represent the error.
-
getErrorCode
public String getErrorCode()
Returns the Error code orDEFAULT_ERROR_CODEif the error code doesn't adequately represent the error.- Returns:
- the Error code or
DEFAULT_ERROR_CODEif the error code doesn't adequately represent the error.
-
getMessage
public String getMessage()
Returns the detail message of this exception.- Overrides:
getMessagein classThrowable- Returns:
- the detail message
-
getRequestTrackingId
public String getRequestTrackingId()
Returns the Request ID (the value of the X-Request-ID header).- Returns:
- Request ID
-
-