Class CAClientException

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

public final class CAClientException extends CAException
The type of exceptions raised by the client.
See Also:
  • Constructor Details

    • CAClientException

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

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

    • requestId

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

      public static CAClientException ofError(CAIResponseError error)
      Transform an error response to an exception.
      Parameters:
      error - The error
      Returns:
      The exception
    • ofException

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