Class ServiceUsageException

    • 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 a ServiceUsageException with the specified detail message.
        Parameters:
        message - exception detail message
      • ServiceUsageException

        public ServiceUsageException​(String message,
                                     String requestTrackingId,
                                     int statusCode)
        Constructs a ServiceUsageException with the specified detail message, requestId and returned HTTP status code.
        Parameters:
        message - exception detail message
        requestTrackingId - X-Request-Id header value to track the request
        statusCode - HTTP Status code returned in API response
      • ServiceUsageException

        public 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.
        Parameters:
        message - exception detail message
        requestTrackingId - X-Request-Id header value to track the request
        statusCode - HTTP Status code returned in API response
        errorCode - Error code returned in API response
    • Method Detail

      • getMessage

        public String getMessage()
        Returns the detailed message for this exception.
        Overrides:
        getMessage in class Throwable
        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 or DEFAULT_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 or DEFAULT_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.