# Class NfcException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.codename1.nfc.NfcException

public class NfcException extends Exception
Thrown via the failure path of an `AsyncResource` returned by `Nfc` when an NFC read, write, or HCE operation fails. `getError()` returns a typed `NfcError` so callers can react without string-matching the message.

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `NfcError`
  `getError()`
  Typed error code describing the failure.

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

- ## Constructor Details

  - ### NfcException

    public NfcException(NfcError error)

  - ### NfcException

    public NfcException(NfcError error, String message)

  - ### NfcException

    public NfcException(NfcError error, String message, Throwable cause)

- ## Method Details

  - ### getError

    public NfcError getError()
    Typed error code describing the failure. Never `null`.