Types & Config

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.

NameTypeDescription
IDBError baseBase error — any unrecognized IndexedDB error
IDBNotFoundError extends IDBErrorStore or index not found
IDBConstraintError extends IDBErrorUnique constraint violated (duplicate key)
IDBVersionError extends IDBErrorVersion mismatch or downgrade attempted
IDBAbortError extends IDBErrorTransaction was aborted
IDBTimeoutError extends IDBErrorOperation timed out

Catching errors

error-handling.ts

Error properties

NameTypeDescription
message stringHuman-readable error message with context
cause DOMException | undefinedThe original native DOMException
name stringError class name (e.g. "IDBConstraintError")

IDBConstraintError also has a .key property, and IDBNotFoundError has a .storeName property.