Skip to main content

Managing errors

During AutomatID initialization and identification flows, several error conditions may arise. Each error is modeled with a domain (string) and a code (integer).

On Android, errors are modeled by the AutomatIdError class. Its nested classes Domains and Codes list the possible values as constants.

On iOS, error domains are modeled as strings while error codes are exposed as an NSEnum and the possible values are in the code documentation for the attributes of the AutomatIDResultError class.

Errors can be recoverable or unrecoverable.

Recoverable errors

Recoverable errors are error situations that may arise during an identification flow and that do not require the identification flow to be aborted and AutomatID UI to be closed. The user can be allowed to try again without going back to your app.

The following table shows the possible recoverable errors:

DomainError code nameError code valueRaised by which SDK methodDescriptionSuggested error handling
server.generic_errorGENERIC_ERROR500startIdentificationAn internal error during the identification flow has happened.Present an error to the user and ask them to retry again later.
server.document_errorEXPIRED_DOCUMENT503startIdentificationThe presented document is expired.Present an error to the user asking them to retry with a document that is not expired.
server.document_errorINVALID_DOCUMENT_DATA506startIdentificationThe data read from the document via NFC is corrupted.Present an error to the user asking them to retry with a valid document.
server.face_errorTOO_MANY_FACES501startIdentificationDuring the liveness check, more than one person's face have been detected by the camera.Present an error to the user asking them to make sure to be alone while performing the liveness check.
server.face_errorNO_FACE_MATCH502startIdentificationThe face acquired during the liveness check doesn't match with the person's photo extracted from the document.The user may be trying to use a document that is not their own. Present an error to the user asking them to use their own document.
server.card_errorNO_CARD_MATCH505startIdentificationThe card presented by the user is not the card that was expected (the read card data doesn't match the JWT card data).Present an error to the user asking them to retry with a valid credit/debit card.
server.card_errorEXPIRED_CARD510startIdentificationThe credit/debit card presented by the user is expired.Present an error to the user asking them to retry with a credit/debit card that is not expired.

When such an error arises, the decideRecoverableErrorHandling() method of your callback is invoked, and the error that occurred is provided to you. Here, you can choose how to treat this error and decide whether the identification flow should allow the user to try again, or the identification flow should be aborted. Depending on your business needs, you could choose to allow the user to always try again, to always abort the identification, or adopt a more complex decision policy. For example, you may want to allow the user to try again up to a certain number of times, after which the identification flow should be aborted. The outcome of your decision must be returned from the onRecoverableError(): the possible values are RETRY_IDENTIFICATION or ABORT_IDENTIFICATION.

If you returned RETRY_IDENTIFICATION, depending on the error, the user will be brought back to the flow at a suitable point where they can try again. For example, if the user provided an expired document, they are brought back to the beginning of the flow; if they failed the liveness check, they will need to perform it again.

If you returned ABORT_IDENTIFICATION, AutomatID will abort the identification flow and the user will be brought back to your app. The onError() method of your callback will be invoked with the error.

Unrecoverable errors

Unrecoverable errors are error situations that may arise during AutomatID initialization or the identification flow, and that will cause the identification flow to be aborted or to never start.

The following table shows the possible unrecoverable errors:

DomainError code nameError code valueRaised by which SDK methodDescriptionSuggested error handling
plugin.configurationCONFIG_FILE_IS_EMPTY1initThe configuration file that was passed to the init() method is empty.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.configurationCONFIG_FILE_DECRYPTION_FAILED2initThe configuration file that was passed to the init() method is corrupted.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.configurationCONFIGURATION_FILE_MALFORMED3initThe configuration file that was passed to the init() method is corrupted.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.configurationINTEGRITY_CHECK_ON_CONFIG_FILE_FAILED4initThe configuration file that was passed to the init() method is corrupted.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.configurationAPP_ID_CHECK_FAILED5initThe configuration file that was passed to the init() method was not generated for the current application. Specifically, the application id doesn't match.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.configurationSDK_MIN_VERSION_CHECK_FAILED6initThe version of AutomatID does not match what is expected in the configuration file.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method. Please verify you are using the expected version of the SDK.
plugin.configurationGENERIC_CONFIG_FILE_READ_AND_PARSING_ERROR7initThere was an error reading the configuration file.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.configurationUNABLE_TO_OPEN_THE_CONFIG_FILE8initThere was an error opening the configuration file.Please verify that the correct configuration file is present in the app build and that its path is correct and provided to the init() method.
plugin.invocationINVOCATION_WITHOUT_INIT9startIdentificationAn identification has been requested but init() was not called.Please call the init() method and verify it completed without errors before calling the startIdentification() method.
plugin.invocationINVALID_PARAMETERS10startIdentificationAn invalid identification request has been passed to the startIdentification() method.If the card scan was selected to be used, a valid cardScanData parameter must be provided.
plugin.device_compatibilityNFC_READER_IS_NOT_PRESENT11startIdentificationThe device is not equipped with NFC hardware.The identification cannot be performed through AutomatID. The app may propose a different identification workflow.
invalid_responseMALFORMED_SUCCESS_RESPONSE12startIdentificationAn internal error during the identification flow has happened.Present an error to the user and notify Opentech of the error.
invalid_responseMALFORMED_ERROR_RESPONSE13startIdentificationAn internal error during the identification flow has happened.Present an error to the user and notify Opentech of the error.
identification_flowUSER_TAPPED_FALLBACK_BUTTON14startIdentificationThe user tapped the fallback button in the identification flow.The user has tapped the fallback button. The identification is closed.
server.card_errorNOT_RECOVERABLE_ERROR522startIdentificationThere was an error in the decryption of the payment card JWT.Please verify that you are constructing and encrypting the JWT with the correct key and according to the documentation.
server.generic_errorBILLING_ERROR523startIdentificationThe user is not enabled to perform the identification (Not registered or contract expired)Please review the status of your contract on AWS Marketplace to ensure that the billing information are valid and up to date.
server.generic_errorPROJECT_NOT_FOUND402startIdentificationThe project where this app was created does not esist (i.e. it was deleted)The deletion of the AutomatID project is irreversible. You cannot use AutomatID in this app any longer.
server.generic_errorAPPLICATION_NOT_FOUND403startIdentificationThe app on AutomatID portal does not esist (i.e. it was deleted)The deletion of the AutomatID app is irreversible. You cannot use AutomatID in this app any longer.

When such an error arises, only the onError() method of your callback is invoked, and the error that occurred is provided to you. The identification flow will be aborted automatically and AutomatID will close.

Errors with domain plugin.configuration and plugin.invocation denote an error that happens during the integration of AutomatID in the development phases, for example related to the usage of a wrong or corrupted configuration file, or the integration of a configuration file that was generated for a certain application, in another application (identified by the application id). Please examine the suggested error handling in the table for guidance.