Changelog - 2026-07-16
Error Handling
Bug Fix Enhancement New APIIn one line. Clients get one normalized message to render and translate any error, you can declare reusable errors in a catalog, and cause finally reaches Error.cause.
What changed
normalizedon every error. One object,{ text, code, args }, is all a client needs. All five handler branches emit it, including validation.causereachesError.cause. It used to be swept intoextra.causewhile the native field stayedundefined. Five framework call sites, including boot failures, lost theircausethis way.- Error catalog. Declare a domain error once with its code, HTTP status and default message, and every call site that raises it stays in sync.
transform. Buildsnormalizedyourself, sonormalized.textcan be a translated string whilemessagekeeps the raw text.- Error layer moved to
@venizia/ignis-inversion. Backend imports are unchanged; keep importing from@venizia/ignis-helpers. Browser applications can now raise and read the same errors as the server, and a second, divergentApplicationErrorin inversion is deleted.
Who is affected
- Clients reading
error.messageCodeorerror.extra.messageArgs. Both still work but are deprecated. Move toerror.normalized.codeanderror.normalized.args. - Browser or frontend apps. Can import
ApplicationError,getErrorand related types from@venizia/ignis-inversion. - Everyone else. No action needed.
getErroraccepts every shape it did before, unknown keys still land inextra, and the wire only gainsnormalized.
typescript
throw getError({ message: 'Active transaction exists', transaction: { id, uid, status } });
// -> error.extra.transaction, exactly as beforeDetails
- Do not spread a definition into
getError.getError({ ...SomeErrors.SOME_ERROR })is wrong: a definition carrieskey, notmessageCode, so the key lands inextra.keyand the error degrades tocore.system_error, which clients cannot localize. Pass it aserrorinstead. The compiler does not catch this. - Typos compile. The index signature that carries your context accepts any key, so
getError({ message, statuscode: 503 })compiles, leavesstatusCodeat400and parks503inextra.statuscode. - Catalog
description. It is the only context a translator gets, so write it for them. - Catalog
key. Declare it as a string literal, notMessageCode.build(...).build()returnsstring, which widens the key registry and silently breaks autocomplete. categoryis metadata for grouping and translator exports and does not reach the response.- Free-form errors.
getError({ message })is unchanged and still right for errors nobody translates. - Across packages. Inversion ships CJS and ESM builds, so
instanceof ApplicationErrorcan still fail across a package boundary. Keep usingisApplicationError().