Files
self/packages/mobile-sdk-alpha/docs/errors.md
Justin Hernandez 61d405f93e [SELF-662] feat: add mobile sdk error classes (#916)
* feat: add typed errors

* docs: add jsdoc comments to error classes

* docs: document sdk error helpers

* pr feedback
2025-08-19 08:10:27 -07:00

12 lines
973 B
Markdown

# Error Classes
| Error Class | Category | Code | Description |
| --------------- | ------------ | -------------------- | ------------------------------------------------------------ |
| `NfcParseError` | `validation` | `SELF_ERR_NFC_PARSE` | Thrown when NFC byte streams are malformed or decoding fails |
| `MrzParseError` | `validation` | `SELF_ERR_MRZ_PARSE` | Raised for invalid MRZ characters or formats |
| `InitError` | `init` | `SELF_ERR_INIT` | Issues during SDK initialization |
| `LivenessError` | `liveness` | `SELF_ERR_LIVENESS` | Errors from liveness checks |
| `SdkError` | varies | custom | Base class for all SDK errors |
Use typed errors instead of generic `Error` to surface clearer failure modes and consistent categorization.