public class ServiceUsageException extends RuntimeException
SdkException
,
ServiceApiException
,
Serialized FormModifier and Type | Field and 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 and Description |
---|
ServiceUsageException(String message)
Constructs a
ServiceUsageException with the specified detail message. |
ServiceUsageException(String message,
String requestTrackingId,
int statusCode)
Constructs a
ServiceUsageException with the specified detail message, requestId and returned HTTP status code. |
ServiceUsageException(String message,
String requestTrackingId,
int statusCode,
String errorCode)
Constructs a
ServiceUsageException with the specified detail message, requestId, returned HTTP status code and error code. |
Modifier and Type | Method and Description |
---|---|
String |
getErrorCode()
Returns the Error code or
DEFAULT_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 or
DEFAULT_STATUS_CODE if the status code doesn't adequately represent the error. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public final int DEFAULT_STATUS_CODE
public final String DEFAULT_ERROR_CODE
public ServiceUsageException(String message)
ServiceUsageException
with the specified detail message.message
- the detail messagepublic ServiceUsageException(String message, String requestTrackingId, int statusCode)
ServiceUsageException
with the specified detail message, requestId and returned HTTP status code.message
- the detail messagerequestTrackingId
- X-Request-Id header value to track the requeststatusCode
- HTTP Status code returned in API responsepublic ServiceUsageException(String message, String requestTrackingId, int statusCode, String errorCode)
ServiceUsageException
with the specified detail message, requestId, returned HTTP status code and error code.message
- the detail messagerequestTrackingId
- X-Request-Id header value to track the requeststatusCode
- HTTP Status code returned in API responseerrorCode
- Error code returned in API responsepublic String getMessage()
getMessage
in class Throwable
public String getRequestTrackingId()
public int getStatusCode()
DEFAULT_STATUS_CODE
if the status code doesn't adequately represent the error.DEFAULT_STATUS_CODE
if the status code doesn't adequately represent the error.public String getErrorCode()
DEFAULT_ERROR_CODE
if the error code doesn't adequately represent the error.DEFAULT_ERROR_CODE
if the error code doesn't adequately represent the error.Copyright © 2023 Adobe. All rights reserved.