Thrown when the user denies camera permissions or camera access is blocked by the browser.Code:FadSDK.Errors.Regula.CAMERA_PERMISSION_DENIEDWhen it occurs:
User explicitly denies camera permission
Browser blocks camera access due to security policies
Camera is already in use by another application
How to handle:
try { const regulaResponse = await FAD_SDK.startRegula( CREDENTIALS, FadSDK.Constants.Regula.CaptureType.CAMERA_SNAPSHOT, idData, idPhoto, CONFIGURATION );} catch (ex) { if (ex.code === FadSDK.Errors.Regula.CAMERA_PERMISSION_DENIED) { // Inform user to enable camera permissions alert('Camera permission denied. Please enable camera access in your browser settings.'); }}
Always check camera permissions before starting the Regula module to provide a better user experience.
Thrown when the face photo cannot be extracted from the ID document.Code:FadSDK.Errors.Regula.ID_PHOTO_NOT_FOUNDWhen it occurs:
Document quality is too poor to extract the face photo
Document doesn’t contain a visible face photo
Lighting conditions prevent photo extraction
Document is partially obscured or damaged
How to handle:
try { const regulaResponse = await FAD_SDK.startRegula( CREDENTIALS, FadSDK.Constants.Regula.CaptureType.CAMERA_SNAPSHOT, true, // idData true, // idPhoto - requesting face photo CONFIGURATION );} catch (ex) { if (ex.code === FadSDK.Errors.Regula.ID_PHOTO_NOT_FOUND) { // Prompt user to retry with better lighting/positioning alert('Face photo not found on ID. Please ensure good lighting and try again.'); // Restart the capture process }}
This error only occurs when idPhoto parameter is set to true in the startRegula() call.