Skip to main content

Error codes

Every MobbScanAPI callback receives a MobbScanAPIError as its last argument. It is null when the operation succeeds.

PropertyTypeDescription
Error codeMobbScanAPIErrorCodeOne of the codes in the table below
getErrorReason()ErrorReasonSpecific reason sent by the backend, when available. See Error reason
extraInfoMap<String, String>Additional details, when available

Handle an error​

Check the error code to decide what to show the user. The most common cases:

CodeRecommended handling
USER_CANCELLED_ERROR, SCANNING_PROCESS_CANCELLEDThe user left the capture: return to the previous step
CONNECTION_ERROR, TIMEOUT_ERRORAsk the user to check the connection and retry
PERMISSION_ERRORRequest the camera (and microphone) permission and retry
DOCUMENT_NOT_VALID, DOCUMENT_NOT_CLASSIFIEDAsk for a valid document; read extraInfo for the reason
LICENSE_ERROR, API_NOT_INITIALIZED_ERRORIntegration issue: check initAPI and the license
val failedValidations = error?.getExtraInfo()?.get("errorDetails")
println("Failed validations: $failedValidations")
// Failed validations: validationDocumentNotExpired

When a document does not pass the validations configured for your process, extraInfo["errorDetails"] lists the failed validations. Their meaning is described in the document object.

Error reason​

getErrorReason() returns the specific reason sent by the backend, or null if there is none. ErrorReason is an extensible class, not an enum: compare predefined reasons with its constants (NOT_VALID_DOCUMENT, NOT_VALID_IMAGE, TOO_MANY_FEW_LINES, EMPTY_CORNERS, QR_NOT_DETECTED, FACE_NOT_DETECTED, BLURRING_CHECK_NOT_PASSED, ERROR_FRONT_DOCUMENT_SIDE_DUPLICATED, ERROR_BACK_DOCUMENT_SIDE_DUPLICATED) and any other reason with getValue().

val reason = error?.getErrorReason()
when {
reason == null -> { /* No error, or the backend did not send a reason */ }
reason == ErrorReason.NOT_VALID_DOCUMENT -> {
val details = error.getExtraInfo()?.get("errorDetails")
// Document validation failed; inspect errorDetails for the specific reasons
}
reason.getValue() == "LIVENESS_FAILED" -> { /* Liveness failed */ }
reason.getValue() == "MATCHING_FAILED" -> { /* Face matching failed */ }
else -> { /* Other backend reasons: generic fallback */ }
}

Error codes​

CodeMeaning
UNEXPECTED_ERRORSomething unexpected happened during the process
CONNECTION_ERRORA network connection error happened
TIMEOUT_ERRORThe process timeout expired
WRONG_PARAMETERS_ERRORSome of the parameters are not valid
SCANNING_PROCESS_CANCELLEDThe user cancelled the scanning process
DOCUMENT_NOT_CLASSIFIEDThe system is not able to classify the document (only applicable for generic document types, i.e. ESP)
DOCUMENT_NOT_VALIDThe document did not pass the validations (applicable when specific validations are activated)
DOCUMENT_NOT_DETECTEDThe document could not be detected
LICENSE_ERRORThe license is not valid or has not been configured
PERMISSION_ERRORThe required app permissions have not been granted
INTERNAL_SERVER_ERRORAn internal server error occurred
UNAUTHORIZED_ERRORThe user is not authorized to perform the action
API_NOT_INITIALIZED_ERRORMobbScanAPI was not properly initialised
DEVICE_NOT_COMPATIBLEDevice does not fulfill the minimum requirements
DOCUMENT_NOT_AVAILABLEThe requested document type is not available
OFFLINE_RESOURCES_NOT_FOUNDOffline resources could not be found
NOT_AVAILABLE_IN_OFFLINE_MODEThis method is not available in offline mode
CAPTURE_FACE_ERRORFacial capture could not be completed
USER_CANCELLED_ERRORThe user cancelled any process (document detection, face validation...)
ANTISPOOFING_ERRORThe antispoofing mechanism cannot ensure the user is genuine
CAMERA_ERRORAn error occurred while managing the camera
ERROR_SCAN_PROCESS_IS_NOT_VALIDThe scan process is not valid for facial verification
SCAN_PROCESS_ALREADY_STARTED_ERRORThe scan process has already been started
FACE_DOCUMENT_NOT_DETECTED_ERRORNo face was detected in the document

Video liveness errors​

Android v2.37.3 maps video-liveness response codes from the service to these MobbScanAPIErrorCode values. Keep the code and scanId in diagnostic logs; show users only a message appropriate to the capture flow.

CodeWhat happenedSuggested handling
VIDEO_LIVENESS_VIDEO_NO_FACENo face was detected in the liveness video.Ask the user to repeat the capture with their face clearly in frame.
VIDEO_LIVENESS_NO_MOVEMENTThe required facial movement was not detected.Ask the user to follow the on-screen prompt and retry the capture.
VIDEO_LIVENESS_INVALID_FORMATThe liveness video could not be processed in its submitted format.Check that the integration supplies a supported video format.
VIDEO_LIVENESS_MULTIPLE_FACESMore than one face was detected in the liveness video.Ask the user to retry with only one person in frame.
VIDEO_LIVENESS_PICTURE_NO_FACENo face was detected in the supplied image.Check that the image contains a visible face before sending it.
VIDEO_LIVENESS_LIVENESS_ERRORLiveness analysis could not be completed.Treat this as a processing error; retain the code and scanId for diagnostics or support.
VIDEO_LIVENESS_MATCHING_ERRORFace matching could not be completed.Check related validation details; do not treat this code alone as a confirmed mismatch.
VIDEO_LIVENESS_WRONG_SCANIDThe scanId does not belong to a started process.Use the scanId returned for the current process.
VIDEO_LIVENESS_SCANID_CREATION_ERRORThe liveness service could not start processing the session.There is no corrective action in the app for this service-side failure. Log the code and scanId; contact support if it persists.
VIDEO_LIVENESS_INVALID_METHODThe selected liveness method is not supported for this process.Check the configured method against the options supported by the SDK/service.
VIDEO_LIVENESS_OUTPUT_GENERATION_ERRORThe liveness service could not produce a result.Log the code and scanId; contact support if it persists.