Error Handling
Overview
As you might have read along these documents, most of the MobbScanAPI
callbacks have an error
as their last argument.
This is the way MobbScan
let you know the reason why a process did not end successfully.
The possible error comes in the form of a MobbScanAPIError
where:
MobbScanAPIErrorCode
: is aString
which value matches the enum typeMobbScanAPIErrorCode
extraInfo
: is aMap
for further information, being both keys and valuesString
Error Codes
The following table shows the possible error codes and their meaning:
Code | Meaning |
---|---|
UNEXPECTED_ERROR | Something unexpected happened during the process |
CONNECTION_ERROR | A network connection error happened |
TIMEOUT_ERROR | The process timeout expired |
WRONG_PARAMETERS_ERROR | Some of the parameters are not valid |
SCANNING_PROCESS_CANCELLED | The user cancelled the scanning process |
DOCUMENT_NOT_CLASSIFIED | The system is not able to classify the document (only applicable for generic document types, i.e. ESP) |
DOCUMENT_NOT_VALID | The document did not pass the validations (applicable when specific validations are activated) |
LICENSE_ERROR | The license is not valid or has not been configured |
PERMISSION_ERROR | The required app permissions have not been granted |
API_NOT_INITIALIZED_ERROR | MobbScanAPI was not properly initialised |
DEVICE_NOT_COMPATIBLE | Device does not fulfill the minimum requirements |
NOT_AVAILABLE_IN_OFFLINE_MODE | The process is only available online |
CAPTURE_FACE_ERROR | Facial detection could not accomplished |
STARTING_VIDEO_ERROR | An error ocurred when starting the unattended video |
FINISHING_VIDEO_ERROR | An error ocurred when finishing the unattended video |
USER_CANCELLED_ERROR | The user cancelled any process (document detection, face validation...) |
VIDEO_RECORDING_ERROR | An error ocurred while the unattended video is being recorded |
ANTISPOOFING_ERROR | The antispoofing mechanism cannot ensure the user is genuine |
VIDEO_LIVENESS_VIDEO_NO_FACE | No faces has been found in the face validation video |
VIDEO_LIVENESS_NO_MOVEMENT | No face movement has been found in the face validation video |
VIDEO_LIVENESS_INVALID_FORMAT | The video provided for the face validation process does not match the required format |
VIDEO_LIVENESS_MULTIPLE_FACES | More than one face has been detected in the face validation video |
VIDEO_LIVENESS_LIVENESS_ERROR | An error ocurred while performing the face detection in the face validation video |
VIDEO_LIVENESS_MATCHING_ERROR | An error ocurred while performing the face matching in the face validation process |
VIDEO_LIVENESS_WRONG_SCANID | Provided scanId does not correspond to a valid started process |
UNATTENDED_VIDEO_TIMEOUT | The unattended video process exceeded the timeout |
UNATTENDED_VIDEO_CANCEL_ERROR | The unattended video cancellation went wrong |
Extra Information
As mentioned above, chances are that a process may need to expose further information about an error. This is an example of what you would get for a scan process when the validations failed:
println("Failed validations: ${error.extraInfo["errorDetails"]}")
System.out.println("Failed validations: " + error.getExtraInfo().get("errorDetails"));
The console will print:
Failed validations: validationMRZ, validationDocumentNotExpired, validationBothSidesMatchScore