# Class WebAuthnException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.codename1.io.webauthn.WebAuthnException

public class WebAuthnException extends IOException
Thrown for failures during a WebAuthn / passkey ceremony driven by `WebAuthnClient`. The `getError()` code mirrors the W3C exception names returned by the platform authenticator (`"NotAllowedError"`, `"InvalidStateError"`, `"NotSupportedError"`, `"SecurityError"`, `"AbortError"`, `"ConstraintError"`) plus Codename One-specific values for transport (`"transport_error"`), parsing (`"invalid_options"`, `"invalid_response"`) and the platform not implementing public-key credentials at all (`"not_supported"`).

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ABORTED`
  The ceremony was cancelled by the caller (e.g.
  `static final String`
  `CONSTRAINT_ERROR`
  One of the option constraints (resident key required, user verification required, etc.) could not be satisfied by the available authenticators.
  `static final String`
  `INVALID_OPTIONS`
  The options JSON received from the relying party could not be parsed.
  `static final String`
  `INVALID_RESPONSE`
  The response JSON returned by the authenticator could not be parsed back into a `PublicKeyCredential`.
  `static final String`
  `INVALID_STATE`
  The credential being created already exists on the authenticator (mapped from the W3C `InvalidStateError` for `create()`), or the requested credential is no longer valid.
  `static final String`
  `NOT_ALLOWED`
  User dismissed the OS passkey sheet, or the OS denied the request because the authenticator was unavailable or no credential matched.
  `static final String`
  `NOT_IMPLEMENTED`
  The platform lacks a public-key credential implementation.
  `static final String`
  `NOT_SUPPORTED`
  The platform does not support the requested public-key algorithm / transport / RP combination.
  `static final String`
  `SECURITY_ERROR`
  Origin / RP-ID validation failed.
  `static final String`
  `TRANSPORT_ERROR`
  Generic transport / network failure (e.g. while POSTing the registration or assertion response to your relying-party server).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WebAuthnException(String error, String message)`
  `WebAuthnException(String error, String message, Throwable cause)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getError()`
  The short error code (see constants on this class).
  `String`
  `getErrorDescription()`
  Human-readable description supplied by the platform or the client.

  ### Methods inherited from class Throwable

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

  ### Methods inherited from class Object

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

- ## Field Details

  - ### NOT_ALLOWED

    public static final String NOT_ALLOWED
    User dismissed the OS passkey sheet, or the OS denied the request because the authenticator was unavailable or no credential matched.
    See Also:
      - Constant Field Values

  - ### INVALID_STATE

    public static final String INVALID_STATE
    The credential being created already exists on the authenticator (mapped from the W3C `InvalidStateError` for `create()`), or the requested credential is no longer valid.
    See Also:
      - Constant Field Values

  - ### NOT_SUPPORTED

    public static final String NOT_SUPPORTED
    The platform does not support the requested public-key algorithm / transport / RP combination.
    See Also:
      - Constant Field Values

  - ### SECURITY_ERROR

    public static final String SECURITY_ERROR
    Origin / RP-ID validation failed. Most often this means the app's associated domain (iOS) or asset link (Android) is not configured for the relying-party identifier in the options JSON.
    See Also:
      - Constant Field Values

  - ### ABORTED

    public static final String ABORTED

    The ceremony was cancelled by the caller (e.g. via

    invalid reference

        WebAuthnClient#cancel()

    ).
    See Also:
      - Constant Field Values

  - ### CONSTRAINT_ERROR

    public static final String CONSTRAINT_ERROR
    One of the option constraints (resident key required, user verification required, etc.) could not be satisfied by the available authenticators.
    See Also:
      - Constant Field Values

  - ### NOT_IMPLEMENTED

    public static final String NOT_IMPLEMENTED
    The platform lacks a public-key credential implementation. iOS < 16, Android API < 28, JavaSE / desktop, web fallback without a native WebAuthn implementation.
    See Also:
      - Constant Field Values

  - ### TRANSPORT_ERROR

    public static final String TRANSPORT_ERROR
    Generic transport / network failure (e.g. while POSTing the registration or assertion response to your relying-party server).
    See Also:
      - Constant Field Values

  - ### INVALID_OPTIONS

    public static final String INVALID_OPTIONS
    The options JSON received from the relying party could not be parsed.
    See Also:
      - Constant Field Values

  - ### INVALID_RESPONSE

    public static final String INVALID_RESPONSE
    The response JSON returned by the authenticator could not be parsed back into a `PublicKeyCredential`.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### WebAuthnException

    public WebAuthnException(String error, String message)

  - ### WebAuthnException

    public WebAuthnException(String error, String message, Throwable cause)

- ## Method Details

  - ### getError

    public String getError()
    The short error code (see constants on this class).

  - ### getErrorDescription

    public String getErrorDescription()
    Human-readable description supplied by the platform or the client.