References
This page contains references for possible error codes, object structure, etc. Most of this can be obtained from the javadoc/clicking into code via Android Studio, but it is also provided here as a reference.
Errors
Section titled “Errors”When an error occurs, unless otherwise specified it will be a SmartCaptureException, which is a custom class that extends RuntimeException.
class SmartCaptureException ( val errorCode: ErrorCode, message: String? = null, cause: Throwable? = null): RuntimeException(message, cause)The noteworthy part here is the errorCode which should help guide implementors as to what type of error occurred and how to proceed in their implementations. The following is a reference of the possible error codes:
enum class ErrorCode { /** * These should not directly happen. If this does occur then it most likely indicates some * form of communication error, for example between an activity's finish() and its calling * method. */ Unknown, /** * An error to do with the camera. Examples could include a camera failing to open, a camera * returning a corrupted stream, a camera failing to free data between frames. This error * generally indicates unusual or damaged hardware or an OS bug. */ CameraError, /** * An error during camera detection. */ DetectionError, /** * A permission was not granted at a time when the permission should have been granted. This * usually indicates a flawed implementation, permissions such as camera or NFC should be * requested and checked before launching the relevant Compose or Activity. */ LackingPermission, /** * An error to do with Nfc reading. This indicates a connection loss by the phone to the nfc * tag. This usually indicates a user moved their phone, but sometimes might indicate * damaged hardware or a bad nfc tag. */ NfcTagLost, /** * An error to do with Nfc reading. This indicates that the chip failed to unlock with the * given data. This usually indicates that an incorrect key was supplied, but sometimes * might indicate damaged hardware or a bad nfc tag. */ NfcInvalidKey, /** * Covers all other errors to do with Nfc reading. Covers cases such as a missing NFC * adapter, incorrect tag detected, chip communication error, or other runtime errors. */ NfcError }