iOS
The CafFaceLivenessLite iOS SDK reports errors through your CafFaceLivenessLiteDelegate. When a run cannot start or cannot finish, the SDK calls didFinishWithError(type:description:).
extension YourViewController: CafFaceLivenessLiteDelegate {
func didFinishWithError(type: CafErrorType, description: String) {
handleError(type, description)
}
}An error is always the last callback of a run: after it, no other result callback is sent for that run.
Where Errors Can Happen
startSDK call
setup was not called.
invalidOptionsException
Camera permission
The user denied camera access.
cameraPermission
Security check
The device is jailbroken, hooked or debugged.
securityException
Session creation
No connection, a server error, a token not valid for this flow, or an incomplete session.
serverException, tokenException, invalidResponseException or unsupportedDevice
Capture
Connection lost, server error, unsupported device, time limit or a capture already active.
networkException, serverException, unsupportedDevice, userTimeoutException, captureAlreadyActiveException or cameraPermission
Capture monitoring
A security threat appears while the camera is open.
securityException
Any step
An unexpected problem not mapped to a specific type.
unexpectedErrorException
setup and prewarm() never report errors:
setuponly stores the configuration. It is checked when you callstartSDK.prewarm()is an optimization. If it fails,startSDKrequests the session again and reports any problem from there.
What Your App Should Do
Log the details. Send
typeanddescriptionto your logs or crash reporting tool.Show your own message. Map the
typeto a localized message. Do not showdescriptionor enum names to your users.Retry only when it can help. Each error type in Error Handling says whether a new attempt helps.
Integration
invalidOptionsException, tokenException, invalidResponseException
User
cameraPermission
Temporary
networkException, serverException, userTimeoutException, captureAlreadyActiveException
Device
securityException, unsupportedDevice
Other
unexpectedErrorException
cancelled() is not an error: the user closed the capture screen. Go back to the previous screen without an error message.
Next Steps
For every error type in detail, with the recommended user message: Error Handling
Last updated

