# @codenhub/error

> Typed error normalization, result helpers, and opt-in browser and Supabase
> registry presets.

Register application mappings explicitly. Deterministic registry matches become
known errors, regex matches become unexpected errors, and unmatched values use
the configured fallback message.

`isAppError` recognizes errors created by the current package runtime.
`AppError` values and read-only registry snapshots are frozen. Raw strings passed
to `err` bypass registry matching and require an explicit safe `fallbackMessage`
to become user-facing.
Mutable registry bucket contents can change, but bucket references cannot be replaced.
Default JSON serialization includes normalized fields and omits diagnostic
`cause` and `originalError` values. Built-in preset `messageKey` values are
stable integration keys for consumer-owned translations; no translation map is
currently bundled.

## Documentation

- [Documentation overview](docs/index.md): Scope, stability, entrypoints, and
  navigation.
- [Error normalization and registries](docs/error-normalization.md): AppError,
  matching, registry APIs, presets, defaults, and failures.
- [Result helpers](docs/results.md): Result types, combinators, and throwing
  behavior.
