# Class CAClientException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.io7m.cardant.error_codes.CAException
com.io7m.cardant.client.api.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:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CAClientException(String message, CAErrorCode inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction, Optional<UUID> inRequestId)`
  Construct an exception.
  `CAClientException(String message, Throwable cause, CAErrorCode inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction, Optional<UUID> inRequestId)`
  Construct an exception.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static CAClientException`
  `ofError(CAIResponseError error)`
  Transform an error response to an exception.
  `static CAClientException`
  `ofException(Throwable ex)`
  Construct an exception from an existing exception.
  `Optional<UUID>`
  `requestId()`

  ### Methods inherited from class com.io7m.cardant.error_codes.CAException

  `attributes, errorCode, exception, remediatingAction`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.io7m.seltzer.api.SStructuredErrorExceptionType

  `getMessage, message`

- ## 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