Errors
Typhon's unified error model: a single-rooted exception hierarchy with numeric error codes and an
IsTransientretry hint, finite per-subsystem timeouts that replace infinite hangs,ExhaustionPolicy-driven bounded-resource failures, and a DEBUG-only declared-access validator. For expected non-error outcomes on hot paths, a zero-allocationResult<TValue,TStatus>struct replaces exceptions entirely β retrying is always the caller's decision, the engine never retries on its own.
π¬ Recommended: read in-depth-overview/14-errors.md (Chapter 14: Errors) first to understand the overall design and concepts behind this category, before diving into the specific features below.
Public Features
| Feature | Summary | Status | Level |
|---|---|---|---|
| TyphonException Hierarchy & Catalog | Base TyphonException (ErrorCode + virtual IsTransient) rooted hierarchy giving callers three catch granularities, with a living catalog of every concrete exception type and a caller-owns-retry philosophy |
β Implemented | π΅ Core |
| IsTransient Retry Hint | A virtual IsTransient flag on every TyphonException hinting whether a retry might succeed, without the engine ever retrying on the caller's behalf |
β Implemented | π΅ Core |
| Timeout Exceptions & Deadline Propagation | Configurable, finite deadlines (TimeoutOptions, WaitContext) replace infinite-wait lock primitives, converting hangs into typed TyphonTimeoutException subclasses plus a bulk-load checkpoint timeout |
β Implemented | π΅ Core |
| Error Code Classification | A numeric TyphonErrorCode per failure, grouped into subsystem ranges (1xxx-8xxx) for logging/metrics dashboards β the exception type, not the code, is what callers catch on |
β Implemented | π£ Advanced |
| Resource Exhaustion Handling | ExhaustionPolicy metadata (FailFast/Wait/Evict/Degrade) documents how the engine reacts when a bounded resource is full β FailFast throws a structured ResourceExhaustedException (IsTransient=true), Wait resources throw a bounded TyphonTimeoutException subclass, never an unbounded hang or InvalidOperationException |
β Implemented | π£ Advanced |
| Storage & Corruption Exceptions | Typed failures for storage I/O, CRC32C page corruption (unhealable), and another-process database-file-lock detection | β Implemented | π£ Advanced |
| Durability (WAL / BulkLoad / Commit) Exceptions | Typed, fail-fast failures from the WAL writer, the commit pipeline's durability wait, and BulkLoad session lifecycle | β Implemented | π£ Advanced |
| Schema & Constraint Violation Exceptions | Engine-refuses-to-proceed failures for the data model: breaking schema mismatch, migration failure, revision downgrade, duplicate unique key | β Implemented | π£ Advanced |
| Runtime/Scheduler Declared-Access Validation | DEBUG-only InvalidAccessException when a system writes a component it never declared via Writes<T>()/SideWrites<T>(), compiled out in RELEASE |
β Implemented | π£ Advanced |
Internal Features
| Feature | Summary | Status |
|---|---|---|
| Result<TValue,TStatus> Hot-Path Result Type | Zero-allocation dual-generic result struct for hot-path lookups that expect a miss β no exceptions, no boxing, no branch on access; used internally by B+Tree/MVCC hot paths, not surfaced through Transaction/Query call sites |
β Implemented |