Summary
All failures surface as bare Error with libredb: prefix strings. Callers must match message text — fragile for a public API surface about to lock.
Audit ID: Section 4 Low — Wave 3 roadmap
Proposal
Design a small typed error taxonomy before API is public-locked:
export class LibreDbError extends Error {
readonly code: "CLOSED" | "NESTED_TX" | "CORRUPT_WAL" | ...;
}
Or discriminated union on cause — research SQLite/libSQL patterns.
Deliverable
- Design note: codes list, stability promise, migration from string matching.
- Implement incrementally starting with kernel errors.
Acceptance criteria
Non-goals
- Full i18n; English messages remain.
Related
- EBADF-on-close issue (subset of codes).
Summary
All failures surface as bare
Errorwithlibredb:prefix strings. Callers must match message text — fragile for a public API surface about to lock.Audit ID: Section 4 Low — Wave 3 roadmap
Proposal
Design a small typed error taxonomy before API is public-locked:
Or discriminated union on
cause— research SQLite/libSQL patterns.Deliverable
Acceptance criteria
code.Non-goals
Related