Class AnkaSecureSdkException

Object
Throwable
Exception
RuntimeException
AnkaSecureSdkException
All Implemented Interfaces:
Serializable

public final class AnkaSecureSdkException extends RuntimeException
Unchecked wrapper for any error returned by the Anka Secure SDK.

Besides the HTTP status and raw response body, the exception carries an arbitrary key/value context map - e.g. kid, oldKid, newKid, jobId. Callers can retrieve those values with ctx(String).

See Also:
  • Constructor Details

    • AnkaSecureSdkException

      public AnkaSecureSdkException(String message, int statusCode, String responseBody, Throwable cause, Map<String,String> context)
      Creates a new SDK exception.
      Parameters:
      message - human‑readable description
      statusCode - HTTP status (or -1 for local/IO errors)
      responseBody - raw server body (may be null)
      cause - root cause (may be null)
      context - extra diagnostic data (immutable copy is stored)
  • Method Details

    • getStatusCode

      public int getStatusCode()
      HTTP status code, or -1 when not applicable.
    • getResponseBody

      public String getResponseBody()
      Raw server body (may be empty).
    • getContext

      public Map<String,String> getContext()
      Returns an unmodifiable view of the context map.
    • ctx

      public String ctx(String key)
      Convenience accessor.
      Parameters:
      key - context key, e.g. "kid"
      Returns:
      the value or null if absent