Package com.amazonaws

Class AmazonServiceException

    • Constructor Detail

      • AmazonServiceException

        public AmazonServiceException​(String errorMessage)
        Constructs a new AmazonServiceException with the specified message.
        Parameters:
        errorMessage - An error message describing what went wrong.
      • AmazonServiceException

        public AmazonServiceException​(String errorMessage,
                                      Exception cause)
        Constructs a new AmazonServiceException with the specified message and exception indicating the root cause.
        Parameters:
        errorMessage - An error message describing what went wrong.
        cause - The root exception that caused this exception to be thrown.
    • Method Detail

      • setRequestId

        public void setRequestId​(String requestId)
        Sets the AWS requestId for this exception.
        Parameters:
        requestId - The unique identifier for the service request the caller made.
      • getRequestId

        public String getRequestId()
        Returns the AWS request ID that uniquely identifies the service request the caller made.
        Returns:
        The AWS request ID that uniquely identifies the service request the caller made.
      • setServiceName

        public void setServiceName​(String serviceName)
        Sets the name of the service that sent this error response.
        Parameters:
        serviceName - The name of the service that sent this error response.
      • getServiceName

        public String getServiceName()
        Returns the name of the service that sent this error response.
        Returns:
        The name of the service that sent this error response.
      • setErrorCode

        public void setErrorCode​(String errorCode)
        Sets the AWS error code represented by this exception.
        Parameters:
        errorCode - The AWS error code represented by this exception.
      • getErrorCode

        public String getErrorCode()
        Returns the AWS error code represented by this exception.
        Returns:
        The AWS error code represented by this exception.
      • setErrorType

        public void setErrorType​(AmazonServiceException.ErrorType errorType)
        Sets the type of error represented by this exception (sender, receiver, or unknown), indicating if this exception was the caller's fault, or the service's fault.
        Parameters:
        errorType - The type of error represented by this exception (sender or receiver), indicating if this exception was the caller's fault or the service's fault.
      • getErrorType

        public AmazonServiceException.ErrorType getErrorType()
        Indicates who is responsible for this exception (caller, service, or unknown).
        Returns:
        A value indicating who is responsible for this exception (caller, service, or unknown).
      • getErrorMessage

        public String getErrorMessage()
        Returns:
        the human-readable error message provided by the service
      • setErrorMessage

        public void setErrorMessage​(String value)
        Sets the human-readable error message provided by the service. NOTE: errorMessage by default is set to the same as the message value passed to the constructor of AmazonServiceException.
        See Also:
        AmazonServiceException(String)
      • setStatusCode

        public void setStatusCode​(int statusCode)
        Sets the HTTP status code that was returned with this service exception.
        Parameters:
        statusCode - The HTTP status code that was returned with this service exception.
      • getStatusCode

        public int getStatusCode()
        Returns the HTTP status code that was returned with this service exception.
        Returns:
        The HTTP status code that was returned with this service exception.
      • getRawResponseContent

        public String getRawResponseContent()
        Typically only useful for debugging purpose if for some reason the SDK cannot parse the HTTP response from a service
        Returns:
        The raw content of the HTTP response as a String.
      • setRawResponseContent

        public void setRawResponseContent​(String rawResponseContent)
        Sets the raw response content.
      • getRawResponse

        public byte[] getRawResponse()
        Returns the response payload as bytes.
      • setRawResponse

        public void setRawResponse​(byte[] rawResponse)
        Sets the raw response content.