Error handling
Interface
Every method calls its error callback with an IMobbScanError object containing these properties:
| Property | Type | Description |
|---|---|---|
errorCode | string | Code that identifies the error |
errorDetails | string | Additional details |
errorReason | string | Specific reason for DOCUMENT_NOT_CLASSIFIED or VALIDATION_ERROR in validateFace. See Codes and reasons |
failedValidations | string[] | Failed validation criteria, for VALIDATION_ERROR only |
A response includes an error code and details, and may also include a specific reason or failed validation criteria:
{
"errorCode": "VALIDATION_ERROR",
"errorDetails": "Some of the validation criteria have failed.",
"errorReason": "FACE_NOT_FOUND",
"failedValidations": ["validationLiveness", "validationIdentityVerification"]
}
Codes and reasons
errorReason provides more detail for document classification and face validation errors. VALIDATION_ERROR may also include a failedValidations list.
CONNECTION_ERRORNetwork error. Ask the user to check the connection and retry.
DOCUMENT_NOT_CLASSIFIEDThe document could not be classified. Read the errorReason and ask for a valid document.4 causes
- ERROR_BACK_DOCUMENT_SIDE_DUPLICATEDBoth captured images are of the back side.
- ERROR_DOCUMENT_SIDE_TYPE_MISMATCHFront and back belong to different document types.
- ERROR_FRONT_DOCUMENT_SIDE_DUPLICATEDBoth captured images are of the front side.
- NOT_VALID_DOCUMENTThe document is not the requested type when creating the process.
ERROR_WRONG_DOCUMENT_TYPEThe document does not match the selected type. Ask the user for the expected document.
FACE_DOCUMENT_NOT_DETECTED_ERRORNo face was found on the document. Ask the user to retry with the portrait side fully visible.
SCAN_PROCESS_ALREADY_STARTED_ERRORThe scanId has already been used. Create a new process in your backend.
UNAUTHORIZED_ERRORThe scanId is wrong or already used, or the token has expired. Create a new process in your backend.
USER_CANCELLED_ERRORThe user cancelled. Return to the previous step.
VALIDATION_ERRORA validation criterion failed. Read failedValidations and ask the user to retry.6 causes
- BAD_FACE_POSITIONThe face is not positioned correctly.
- BAD_LIGHTINGThe lighting does not allow proper verification.
- FACE_NOT_FOUNDNo valid face was detected.
- FACE_SERVICE_ERRORCommunication with the verification service failed.
- MULTIPLE_FACES_DETECTEDMore than one face was detected.
- VALIDATION_MATRIX_NOT_PASSEDSome validation criteria failed.
WRONG_PARAMETERS_ERRORInvalid parameters. Check the token and scanId.
Validation errors
For VALIDATION_ERROR, failedValidations lists the criteria that did not pass. See Validation criteria.