Skip to main content

Error handling

All error handling for the Web SDK is centralized in this section. The error callback receives an ErrorBio object exposing getCode() and getDescription().

prepareCamera errors
CodeDescription
73000Unknown and unexpected error during normal usage of SDK APIs
73001<property> is required
73002<property> must be an instance of <class>
73003<class> with name <name> is not available to inject
73004Class type must be a function or a class
73005Could not find the <locale> locale
73006Could not find text: <text>
73100Unable to connect to internet
73200Could not find the Unico SDK JSON file
73201Could not load the Unico SDK JSON file
73202Unico SDK JSON file is invalid
73204Unable to initialize the SDK — configure the environment via setEnvironment on build
73300Could not authenticate this application
73301Could not authenticate this application
73302Authentication token not found
73303Current host is not registered
73400Could not initialize camera
73401Could not load ML models for this camera
73402The Key could not be verified due to connectivity issues on the user's device
73403This device/platform/browser/version combination is not supported by the SDK
73404Device is in landscape display orientation. The SDK can only be used in portrait
73405Device blocked due to multiple failed attempts
73406The session was cancelled — the SDK was opened in an iFrame
73407The SDK was not fully loaded
73500Could not get session
73501Could not get session
73502Session token not found
73600Could not find camera resource
73601Could not start camera in production mode
74000Invalid hexadecimal
74001Object is not a UnicoTheme
openCamera errors
CodeDescription
73700Could not parse camera response
73704The user pressed the cancel button and did not complete the session
73706Camera access denied — user explicitly denied permission or device policy blocks it
73707The session was cancelled due to the app being terminated, sleeping, OS notification, or backgrounded
73708The session was cancelled because the device is in landscape mode
73710The session was cancelled because the user could not complete it within the allotted timeout
73715The session was cancelled because not all guidance images were configured
73716The session was cancelled because the SDK was unable to start the camera on this device
73717The session was cancelled because the user was in a locked-out state
73718Unknown and unexpected error during normal usage of SDK APIs
73720The developer programmatically called the session cancel API
73721The session was cancelled due to a device orientation change during the session
73722The session was cancelled because the document is not ready
73723The session was cancelled because there was another session in progress
73724The session was cancelled because the camera was opened in an iFrame
73728Connection error — please use HTTPS to connect
73729Browser not supported — please open in another browser
73730Unable to initialize an active liveness session — unknown license error
73731Unable to initialize an active liveness session — license expired
73732Unable to initialize an active liveness session — origin is not permitted
73800Could not encrypt response
73900Could not get system information
Official error catalog

The codes above reflect the Web SDK catalog. The official cross-platform error code catalog is available at API Reference > Error codes.

Handling the callback
const callback = {
on: {
success: (obj) => {
console.log(obj.base64);
console.log(obj.encrypted);
},
error: (error) => {
const code = error.getCode();
const description = error.getDescription();
// handle error
}
}
};
Mandatory callback

The callback object is mandatory. If not properly implemented (covering both success and error events), the SDK raises an exception that, if not handled, is displayed in the user's console.