> For the complete documentation index, see [llms.txt](https://api2-ekycapis.innov8tif.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api2-ekycapis.innov8tif.com/okayid-offline-mobile-sdk/okayid-offline-mobile-sdk-all/ios-sdk/error-handling.md).

# Error Handling

### Standard ID capture

Inspect `result.errorMessages` on every completion:

```swift
if result.errorMessages.isEmpty {
    // No errors or warnings were reported.
} else {
    result.errorMessages.forEach { message in
        print("OkayID:", message)
    }
}
```

An error message does not always mean that every output is unavailable. For example, image-quality validation may report glare or blur while still returning original images, cropped images, or partially populated OCR models.

Check the individual result properties before discarding the result.

#### Common flow-level messages

| Message                                             | Meaning                                                          |
| --------------------------------------------------- | ---------------------------------------------------------------- |
| `No OkayID license provided.`                       | The license parameter was empty.                                 |
| `Invalid, expired, or incompatible OkayID license.` | The license failed validation or does not match the application. |
| `Unsupported ID document type.`                     | The selected document type is not supported.                     |
| `Unsupported ID capture mode.`                      | The selected capture mode is not supported.                      |
| `ID capture was cancelled.`                         | The user closed the SDK before completion.                       |

### Passport capture

Passport capture currently returns `(nil, nil)` when it is cancelled, rejected by license validation, or cannot produce a result.

### MyKad V2 BlinkID capture

Inspect both values returned to the completion handler:

```swift
if let result {
    // Use the available images and OCR fields.
    if let error {
        // Present or log the OCR warning.
    }
} else if let error {
    // Handle cancellation, license failure, incomplete capture, or busy OCR.
}
```

The BlinkID flow may report that both input images were not returned or that XenIdentity is already processing another image.

> Start only one MyKad V2 OCR flow at a time.
