Error Handling
Typed error classes that wrap native IndexedDB DOMExceptions.
Error hierarchy
All errors extend the base IDBError class, which wraps native DOMException errors with better messages and context.
| Name | Type | Description |
|---|---|---|
IDBError | base | Base error — any unrecognized IndexedDB error |
IDBNotFoundError | extends IDBError | Store or index not found |
IDBConstraintError | extends IDBError | Unique constraint violated (duplicate key) |
IDBVersionError | extends IDBError | Version mismatch or downgrade attempted |
IDBAbortError | extends IDBError | Transaction was aborted |
IDBTimeoutError | extends IDBError | Operation timed out |
Catching errors
error-handling.ts
Error properties
| Name | Type | Description |
|---|---|---|
message | string | Human-readable error message with context |
cause | DOMException | undefined | The original native DOMException |
name | string | Error class name (e.g. "IDBConstraintError") |
IDBConstraintError also has a .key property, and IDBNotFoundError has a .storeName property.