Purpose
Client-safe codes and resolvers (translateError, resolveErrorMessage, getFieldErrors) turn transport errors into localized messages. Leaf policy subpaths share the mutation-toast rule (./mutation-toast), the TanStack Query retry policy (./query-retry), what a client does with a failed collection write (./write-outcome), and which kind of error an error screen shows, with whether it offers "Report a problem" (./error-kind), across web and mobile. Server handling logs unexpected failures and maps known errors to oRPC responses. Auth-client helpers interpret Better Auth errors.
Public exports
| Subpath | Target |
|---|---|
. | ./src/index.ts |
./auth-client-error | ./src/auth-client-error.ts |
./error-kind | ./src/error-kind.ts |
./locales | ./src/locales/index.ts |
./mutation-toast | ./src/mutation-toast.ts |
./query-retry | ./src/query-retry.ts |
./server | ./src/server.ts |
./write-outcome | ./src/write-outcome.ts |
These paths come from packages/errors/package.json. A . entry is the package root. Conditional targets distinguish platform or type resolution; consumers should import the subpath, not its source file.
How to extend
Introduce a stable code and catalog messages for an actionable new failure. Preserve its typed path across the boundary; do not display raw database/provider exception text.
Read the stable error vocabulary guide for the full flow.