Error handling
Interface
Every method reports failures through its error callback with these properties:
| Property | Type | Description |
|---|---|---|
errorCause | string | Specific cause, when available. See Codes and causes. |
errorCode | string | Code that identifies the error. |
errorDetails | string | Additional information about the error. |
A response includes an error code and details, and may also include a more specific cause:
{
"errorCause": "USER_NOT_FOUND",
"errorCode": "WRONG_PARAMETERS_ERROR",
"errorDetails": "Some of the parameters are not valid"
}
Codes and causes
Each code lists the method that returns it and recommended handling. Specific causes are shown in a separate group.
CONNECTION_ERRORNetwork error. Ask the user to check the connection and retry.
SAMPLE_ERRORInvalid sample. Ask the user to retry with good lighting, alone in front of the camera.
UNAUTHORIZED_ERRORThe token has expired. Request a new one from your backend.1 cause
- APPLICATION_NOT_FOUNDThe application ID is not valid.
USER_CANCELLED_ERRORThe user cancelled. Return to the previous step.
WRONG_PARAMETERS_ERRORInvalid parameters. Check the values passed to the method.1 cause
- USER_NOT_FOUNDThe user is not enrolled. Enrol the user before verifying them.