Skip to main content
Failures are typed, so you branch on them without parsing strings.
  • WorkflowFailure: why a step’s most recent attempt failed. It’s on every step outcome (run.steps[i].failure), both while the step can still be retried and once it can’t.
  • WorkflowSessionFailure: why a run ended without being submitted. It’s on run.sessionFailure.

What the SDK does for you

In DeepIDVWorkflowView, a failed attempt with attempts left shows a retry screen and redoes only what failed:
iPhone screen: 'We couldn't read your ID', advice to place the ID on a flat surface in good light and avoid glare, '2 attempts left', and Try again and Cancel buttons.

A retry with attempts left.

You only handle failures yourself when the run ends.

WorkflowFailure

WorkflowSessionFailure

Rules for robust code

  • Codes are open sets. WorkflowFailure.Code, WorkflowSessionFailure.Code and APIErrorCode are structs, not enums. A newer server can send a code this SDK version doesn’t know; it arrives in rawValue. Always keep a default branch.
  • Prefer category and userAction for decisions. They’re small and stable.
  • Don’t show message to users. Write your own copy from code or userAction.
  • Scores and thresholds aren’t exposed to the app.