Class IdAClientException

All Implemented Interfaces:
com.io7m.seltzer.api.SStructuredErrorExceptionType<IdErrorCode>, com.io7m.seltzer.api.SStructuredErrorType<IdErrorCode>, Serializable

public final class IdAClientException extends IdException
The type of client exceptions.
See Also:
  • Constructor Details

    • IdAClientException

      public IdAClientException(String message, IdErrorCode inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction, Optional<UUID> inRequestId)
      Construct an exception.
      Parameters:
      message - The message
      inErrorCode - The error code
      inAttributes - The error attributes
      inRemediatingAction - The remediating action, if any
      inRequestId - The request ID
    • IdAClientException

      public IdAClientException(String message, Throwable cause, IdErrorCode inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction, Optional<UUID> inRequestId)
      Construct an exception.
      Parameters:
      message - The message
      cause - The cause
      inErrorCode - The error code
      inAttributes - The error attributes
      inRemediatingAction - The remediating action, if any
      inRequestId - The request ID
  • Method Details

    • ofException

      public static IdAClientException ofException(Throwable ex)
      Construct an exception from an existing exception.
      Parameters:
      ex - The cause
      Returns:
      The new exception
    • requestId

      public Optional<UUID> requestId()
      Returns:
      The ID associated with the request, if the server returned one
    • ofError

      public static IdAClientException ofError(IdAResponseError error)
      Transform an error response to an exception.
      Parameters:
      error - The error
      Returns:
      The exception