Skip to main content
Version: 1.6.0 and above

IDnowDocIDVError

Error thrown by start(token:isRoutedSession:preferredLanguage:viewController:bindingKey:).

public enum IDnowDocIDVError: Error {
case cancelled(reason: AbortReason, message: String)
case token(error: TokenError, message: String)
case network(error: NetworkError, message: String)
case internalError(code: Int, message: String)
}

Cases

CaseAssociated ValuesDescription
cancelledreason: AbortReason, message: StringThe session was cancelled by the user
tokenerror: TokenError, message: StringThe session token is invalid
networkerror: NetworkError, message: StringA network error occurred
internalErrorcode: Int, message: StringAn unexpected internal error occurred

Example

do {
try await IDnowDocIDV.shared.start(
token: "XYZ-ABCDE",
viewController: self
)
} catch let error as IDnowDocIDVError {
switch error {
case .cancelled(let reason, let message):
print("Cancelled: \(reason) - \(message)")
case .token(let error, let message):
print("Token error: \(error) - \(message)")
case .network(let error, let message):
print("Network error: \(error) - \(message)")
case .internalError(let code, let message):
print("Internal error \(code): \(message)")
}
}

AbortReason

Reason provided when the error case is cancelled.

public enum AbortReason
CaseDescription
appNotRespondingThe app stopped responding during the session
documentNotAvailableThe required document was not available
notInterestedThe user chose not to proceed
privacyConcernsThe user declined due to privacy concerns
otherAnother unspecified reason
appNotScanningThe app failed to scan the document
cameraAccessDeniedThe user denied camera access
documentExpiredThe provided document is expired
documentNotAcceptedThe document type is not accepted
identifyLaterThe user chose to identify at a later time
selfieNotReadyThe selfie capture failed or was not ready
noPinNo PIN was provided (eID only)

TokenError

Error detail provided when the error case is token.

public enum TokenError
CaseDescription
formatErrorThe token format is incorrect
notFoundThe token was not found
expiredOrDeletedThe token has expired or been deleted
alreadyCompletedThe session associated with this token is already completed
viTokenA VideoIdent token was used instead of a DocIDV token

NetworkError

Error detail provided when the error case is network.

public enum NetworkError
CaseDescription
noInternetConnectionNo internet connection is available
tlsPinFailedTLS certificate pinning validation failed
serverNotReachableThe IDnow server could not be reached