SDK errors

Format

All errors triggered by the SDK have the following properties:

Field

Type

Description

id

string

Error identifier

message

string

Additional Message

Tip: You can use the call isSdkError(error) to check if an error is in this format:

const identity = new Sdk(identityToken, options);

try {
    const response = await identityentity.verifyPolicy(cpfInput.value, policyInput.value);
}
catch (error) {
    if(identity.isSdkError(error)) {
        // The error is in the format above
    }
}

Types of errors

UnsupportedError

ID: UNSUPPORTED

Description: Triggered when the user's browser does not support some feature necessary for the SDK to work

PermissionDeniedError

ID: PERMISSION_DENIED

Description: Triggered when the SDK has not been given permission to perform an action (such as opening the camera)

AlreadyRunningError

ID: ALREADY_RUNNING

Description: Triggered when the throwOnRecall flag is set in the SDK options and a verification call is made while another one is already in progress.

UserCanceledError

ID: USER_CANCELED

Description: Triggered when the user cancels an SDK operation

NetworkError

ID: NETWORK_ERROR

Description: Triggered when a request to our servers fails

InvalidResponseError

ID: INVALID_RESPONSE

Description: Triggered when a request to our servers did not get the expected result

InternalServerError

ID: INTERNAL_SERVER_ERROR

Description: Triggered when there was an internal error in our servers

TimeoutError

ID: TIMEOUT

Description: Triggered when some request from the SDK (not necessarily from the network) has exceeded the time limit

UnknownError

ID: UNKNOWN

Description: Triggered when an unknown error occurred

ContextPending

ID: CONTEXT_PENDING

Description: Triggered when the context is pending manual analysis.

FaceAuthentication

ID: FACE_AUTHENTICATION

Description: Triggered when an error occurs in the face authentication flow.

The SDK does not return explicit exceptions about refusal reasons for authentication. Refusal reasons can be obtained from the API response that looks for a specific authentication attempt.

Last updated

Logo

2023 © Caf. - All rights reserved