Error handling
Overview
As you might have read along these documents, most of the MobbIDAPI callbacks have an error as their last argument.
This is the way MobbID let you know the reason why a process did not end successfully.
The possible error comes with the general structure as follows:
{
"errorCode": "WRONG_PARAMETERS_ERROR",
"errorDetails": "Some of the parameters are not valid"
}
where:
errorCode: is astringand represents the specific code identifying the error.errorDetails: is astringand provides additional information or context about the error.
Error codes
The following table shows the possible error codes and their meaning:
| Code | Meaning | Method |
|---|---|---|
CONNECTION_ERROR | A network connection error happened. | initSdk |
SAMPLE_ERROR | Invalid sample: low quality, multiple faces, etc. | faceVerification |
UNAUTHORIZED_ERROR | Invalid credentials for this method. | initSdk |
USER_CANCELLED_ERROR | Back button pressed during operation. | faceVerification |
WRONG_PARAMETERS_ERROR | Invalid parameters used. | initSdk, faceVerification |
Error causes
Additionally, some errors may include a more specific cause of the problem.
{
"errorCause": "USER_NOT_FOUND"
}
The following table shows the possible error causes and their meaning:
| Cause | Meaning | Method |
|---|---|---|
APPLICATION_NOT_FOUND | An incorrect applicationdId has been used. | initSdk |
USER_NOT_FOUND | An userId not previously registered has been used. | faceVerification |
