Mobbeel for developers

Mobbeel for developers

  • MobbScan
  • MobbID
  • MobbSign
  • Clients
  • FAQ

MobbScan Web: Error Handling

Error codes

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 following tables shows the possible error codes according to the step in which they occur and their meaning:

Global (all steps)

CodeMeaning
CONNECTION_ERRORCould not connect to the server
ERROR_SCAN_PROCESS_IS_NOT_VALIDThe step did not pass the validations (applicable when specific validations are activated). In this case, failed validations will be returned in the scanProcessFailedValidations field
ERROR_SCAN_PROCESS_NOT_STARTEDProvided scanId does not correspond to a started process
LICENSE_ERRORThe license provided is not valid or has not been configured
TIMEOUT_ERRORThe operation could not be done in time
WEBCAM_ERRORWebcam unexpected error
WEBCAM_NO_DEVICES_FOUNDNo webcam found
WEBCAM_NOT_AVAILABLEWebcam not available. There is another process using the webcam
WEBCAM_NOT_SUPPORTED_ERRORWebcam not supported. HD resolution is needed
WEBCAM_PERMISSION_DENIEDWebcam permission denied

SDK initialization

CodeMeaning
ERROR_WRONG_DOCUMENT_TYPEThe document type provided is not valid
ERROR_WRONG_OPERATION_MODEThe operation mode provided is not valid
PLACEHOLDER_NOT_CONFIGURED_ERRORPlaceholder is not configured with setPlaceHolder method
PROTOCOL_ERRORThe procol is wrong, should be HTTPS
WRONG_PARAMETERS_ERRORError in the parameters received: missing, incorrect types, etc

Document

CodeMeaning
ERROR_DOCUMENT_ALREADY_SCANNEDA document has already been scanned with the current scanId
ERROR_DOCUMENT_NOT_CLASSIFIEDThe system is not able to classify the document (only applicable for generic document types, i.e. ESP)
MAX_FILE_SIZE_TO_SCAN_ERRORThe size of the file to scan is greater than maximum setted

Face

CodeMeaning
ERROR_WRONG_VALIDATION_TYPEThe validationType provided for the face validation process does not match a valid type

Liveness

CodeMeaning
ERROR_CONNECTING_FACIAL_LIVENESS_SERVICEError connecting to liveness detection service
ERROR_CONNECTING_FACIAL_MATCHING_SERVICEError connecting to facial matching service
ERROR_PROCESSING_VIDEOError while processing liveness video
INVALID_SCANIDThe scanId provided for the liveness validation does not correspond to a valid started process
INVALID_VIDEO_FORMATThe video provided for the liveness validation does not match the required format
MOVEMENT_NOT_FOUNDNo face movement has been found in the face validation video
MULTIPLE_FACES_FOUNDMore than one face has been detected in the face validation video
VALID_FACE_NOT_FOUNDNo faces has been found in the face validation video

Managing timeout error

Document detection timeout

If a document takes too much time to be detected, a timeout error will be triggered. These type of error triggers its own listener and can be defined as follows:

const timeoutListener = evidence => console.error('Timeout from', evidence);

MobbScanAPI.setTimeOutListener(timeoutListener);

On the other hand, this timeout is also received in the document detection listener, established by the setDetectionListener method. It is obtained in the result field as TIMEOUT.

It can be configured at sdk initialization using the MobbScanAPI.setDetectionTimeOut method:

MobbScanAPI.setDetectionTimeOut(Xseconds);

Face detection timeout

If a face takes too much time to be detected, a timeout error will be triggered. This timeout is received in the face detection listener, established by the setFaceDetectionListener method. It is obtained in the result field as TIMEOUT.

It can be configured at sdk initialization using the MobbScanAPI.setFaceDetectionTimeOut method:

MobbScanAPI.setFaceDetectionTimeOut(Xseconds);

Liveness detection timeout

If a liveness process takes too much time to be completed, a timeout error will be triggered. This timeout is received in the face detection listener, established by the setFaceDetectionListener method. It is obtained in the result field as TIMEOUT.

It can be configured at sdk initialization using the MobbScanAPI.setLivenessTimeOut method:

MobbScanAPI.setLivenessTimeOut(Xseconds);

The call must be placed before the MobbScanAPI.start method call, which is responsible for starting process:

// Sets liveness timeout
MobbScanAPI.setLivenessTimeOut(60);

// Starts scanning
MobbScanAPI.start(
    MobbScanDocumentType.ESPIDCard,
    MobbScanOperationMode.SCAN_BOTH_SIDES,
    (result, resultData, error) =>
        console.log('API has started with scan id: ', resultData.scanId);
);

If the liveness is part of a flow with previous document detection, the call must be placed before the MobbScanAPI.detectFace method:

// Sets liveness timeout
MobbScanAPI.setLivenessTimeOut(60);

// Starts face detection
MobbScanAPI.detectFace('YOUR SCAN ID', 'mobbscan-placeholder');

If this parameter is not specified, the default value will be 1 minute for iOS devices and 30 seconds for all other devices.

Record Video timeout

If a document or a face takes too much time to be detected, a timeout error will be triggered. This timeout is received in the record video listener, indicated in the startUnattendedVideo method. It is obtained in the result field as TIMEOUT.

  • Document detection timeout can be configured at sdk initialization using the MobbScanAPI.setDetectionRecordTimeOut method:
MobbScanAPI.setDetectionRecordTimeOut(Xseconds);

Note: To know if the timeout occurs in the document or face detection, it could be used data.side. If the data.side field is undefined, a timeout error has occurred in the video record total duration.

  • Face detection timeout can be configured at sdk initialization using the MobbScanAPI.setFaceDetectionTimeOut method:
MobbScanAPI.setFaceDetectionTimeOut(Xseconds);

Managing errors on document scan listener

As you will read in the listeners descriptions, almost every MobbScan listener will receive an error parameter as a third argument when it is triggered.

The most relevant errors occur in document scanning and are the following:

Document not classified error

When this error occurs, error field contains ERROR_DOCUMENT_NOT_CLASSIFIED Reason: NOT_VALID_DOCUMENT.

Example

If you carry out the process with a document that doesn't correspond to the indicated type, the error field would contain the following:

'ERROR_DOCUMENT_NOT_CLASSIFIED Reason: NOT_VALID_DOCUMENT';

Document not valid error

When this error occurs, error field contains an object with the following attributes:

  • Description: It contains ERROR_SCAN_PROCESS_IS_NOT_VALID.
  • ScanProcessFailedValidations: It contains a list with the validations that the document hasn't passed in its scan. If you want to know more about the different validations extracted from the documents, you can go to Types of validations section.

Example

If you carry out the process with a document that doesn't pass any of the activated validations (in this case documentNotExpired validation), the error field would contain the following:

// Error
{
    description: 'ERROR_SCAN_PROCESS_IS_NOT_VALID',
    scanProcessFailedValidations: ['validationDocumentNotExpired']
}

Managing camera issues

There is a specific listener that will be triggered if the camera initialization fails. It can be defined as follows:

MobbScanAPI.setErrorAccessingCamera(console.error);
  • Error codes
    • Global (all steps)
    • SDK initialization
    • Document
    • Face
    • Liveness
  • Managing timeout error
    • Document detection timeout
    • Face detection timeout
    • Liveness detection timeout
    • Record Video timeout
  • Managing errors on document scan listener
    • Document not classified error
    • Document not valid error
  • Managing camera issues
Mobbeel for developers
Product Documentation
MobbIDMobbScanMobbSign
Connect
LinkedInFacebookX
More
FAQContact Us
Mobbeel Solutions SL
Copyright © 2026 Mobbeel Solutions SL