Facetec Error Codes
The Facetec module provides 3D liveness detection and face scanning capabilities. Errors are organized into categories based on the phase where they occur.Error Structure
All errors follow theResponseError structure:
Session Errors
Errors that occur during the Facetec session initialization and camera setup.Session.CAMERA_NOT_RUNNING
Thrown when the camera fails to start or stops unexpectedly during the session. Code:FadSDK.Errors.Facetec.Session.CAMERA_NOT_RUNNING
When it occurs:
- Camera permission denied by user
- Camera is in use by another application
- Camera hardware failure
- Browser doesn’t support camera access
- Mobile device has disabled camera access
Session.INITIALIZATION_NOT_COMPLETED
Thrown when Facetec SDK initialization fails to complete successfully. Code:FadSDK.Errors.Facetec.Session.INITIALIZATION_NOT_COMPLETED
When it occurs:
- Network timeout during SDK initialization
- Invalid or expired Facetec credentials
- Facetec service unavailable
- Browser compatibility issues
- WebAssembly not supported
Check your network connection and verify that your Facetec credentials are valid when this error occurs.
Status Errors
Errors related to the liveness detection process status and completion.Status.TIMEOUT
Thrown when the liveness detection process exceeds the maximum allowed time. Code:FadSDK.Errors.Facetec.Status.TIMEOUT
When it occurs:
- User takes too long to complete the liveness check
- Network latency causes processing delays
- Poor device performance slows down face detection
- User doesn’t follow on-screen instructions
Consider adjusting timeout settings in your configuration if users frequently experience this error.
Complete Error Handling Example
Response Data Structure
When successful, Facetec returns the following data:Error Recovery Strategies
Camera Access Issues
Camera Access Issues
When
CAMERA_NOT_RUNNING occurs:- Check if camera permissions are granted
- Verify camera is not in use by another app
- Test camera functionality with native browser APIs
- Provide step-by-step permission instructions
- Offer alternative authentication methods
Initialization Failures
Initialization Failures
When
INITIALIZATION_NOT_COMPLETED occurs:- Implement retry logic with exponential backoff
- Verify network connectivity
- Check Facetec service status
- Validate credentials
- Clear browser cache if persistent
Timeout Handling
Timeout Handling
When
TIMEOUT occurs:- Display clear, step-by-step instructions before starting
- Show progress indicators during the check
- Provide countdown timer if appropriate
- Consider increasing timeout in configuration for slow devices
- Offer practice mode for first-time users
Best Practices
Pre-session Validation
Always verify camera availability and permissions before starting Facetec to avoid runtime errors.
User Experience
Show a tutorial or guide before the first liveness check to reduce timeout errors and improve success rates.
Network Resilience
Implement retry logic for initialization failures, as they’re often temporary network issues.
Device Compatibility
Test on target devices and browsers. Facetec requires WebGL and WebAssembly support.
Browser Requirements
Facetec requires modern browsers with:
- WebGL support
- WebAssembly (WASM) support
- Camera API access
- Minimum recommended: Chrome 80+, Safari 13+, Firefox 75+