Skip to Content

Errors

All errors extend SladeIDError and carry a code: string field. Catch by class for broad recovery, branch on code for specifics.

Core errors

ClassCodeThrown whenRecovery
SladeIDErrorCONFIG_INVALIDRequired config missing (e.g. middlewareUrl)Fix config
SladeIDErrorCONFIG_NOT_SUPPORTEDencryptBiometrics.face set true (unsupported in V0)Drop the option
SladeIDErrorBAD_REQUESTBackend returned a 4xx the SDK didn’t map (no code in body)Fix the request
CaptureErrorCAMERA_PERMISSION_DENIEDUser blocked or dismissed the camera promptSurface a permission UI; see the camera guide
CaptureErrorCAMERA_NOT_FOUNDNo camera device is presentAsk the user to connect a camera
CaptureErrorCAMERA_IN_USECamera is held by another app or tabAsk the user to close the other consumer
CaptureErrorCAMERA_ACCESS_FAILEDgetUserMedia failed for another reasonRetry; verify the device
CaptureErrorSESSION_ALREADY_STARTEDstart() called twiceCall stop() first
CaptureErrorNOT_IMPLEMENTED_V0Active liveness challenges configuredActive challenges are not implemented; omit activeChallenges
CaptureErrorNO_CAMERACapture attempted before the camera stream was readyWait for 'started'
CaptureErrorNO_CANVAS_CTXCanvas 2D context unavailableVerify the environment supports <canvas>
CaptureErrorCAPTURE_FAILEDcanvas.toBlob returned null, or capture canceledRetry
QualityErrorFACE_QUALITY_EXHAUSTEDMax face-quality retries exceededImprove lighting, framing
NetworkErrorTIMEOUTBackend took longer than timeoutMsRetry; bump timeoutMs if justified
NetworkErrorNETWORK_FAILUREfetch rejected (DNS, CORS, offline)Check connectivity, CORS config
NetworkErrorSERVER_ERRORBackend returned a 5xxRetry; escalate with X-SDK-Version
NetworkErrorNON_JSON_RESPONSEA 2xx body wasn’t valid JSONCheck the backend / any proxy in front of it
AuthErrorUNAUTHORIZEDBackend returned 401Token expired or rejected; backend mints a fresh one, SDK re-requests via getToken()
AuthErrorFORBIDDENBackend returned 403Check the token’s scope / roles

EncryptionError (codes NO_WEB_CRYPTO, NO_BASE64) is forward-compat only; face payloads are sent as plaintext base64 via NoopEncryptor. In V0 a missing base64 codec surfaces as a SladeIDError/CaptureError with code NO_BASE64, not an EncryptionError.

Fingerprint reader errors

Thrown by the fingerprint reader client. All extend HwsError and carry an optional correlationId field for support tickets.

ClassCodeThrown when
ConnectionErrorREADER_CONNECTION_FAILEDThe local hardware service is unreachable (companion app not running).
TimeoutErrorREADER_TIMEOUTNo finger was presented within the capture window.
ReaderAuthErrorREADER_AUTH_FAILEDThe bearer was rejected, or getToken threw / returned empty.
DeviceUnavailableErrorREADER_DEVICE_UNAVAILABLENo scanner is available, or no workstation could be resolved.
ReaderValidationErrorREADER_VALIDATION_FAILEDThe request was rejected — bad input, or verify() with no enrolled template.
DuplicateEnrollmentErrorREADER_DUPLICATE_TEMPLATEenroll() on a finger that already has a live record. Subclasses ReaderValidationError, so existing instanceof handling still matches; the narrower code is what lets you branch without reading the message.
ReaderServerErrorREADER_SERVER_ERRORThe validator or database was unavailable while matching.
BiometricMismatchErrorREADER_BIOMETRIC_MISMATCHRejection-style helpers only; plain verify() resolves { matched: false }.
HwsErrorREADER_DISPOSEDAn action was called after dispose().
HwsErrorREADER_CANCELLEDA session was cancelled before its job was dispatched.
HwsErrorREADER_SESSION_REUSEDstart() called twice on a single-shot session.
HwsErrorREADER_EMPTY_TEMPLATEtestCapture() came back with no template.

A failed biometric match is not an error: verify() resolves { matched: false } and search() resolves { found: false }.

And note that not every reader failure is an HwsError. Enroll, verify, and search are dispatched over the shared middleware transport, so an HTTP-level refusal surfaces as a NetworkError or AuthError from the core table above — most commonly NetworkError / SERVER_ERROR carrying Middleware returned 503: Target workstation is not currently live. when the target workstation is offline. SladeIDError is the common ancestor of both families.

See also