error-handling-conventions

Handles errors with cause chains, typed results, one API error envelope, no log-and-throw and no empty catch.

Group
Conventions
Kind
Read-only
Loads when
Writing or reviewing error handling in TypeScript

When it runs

When error handling is being written or reviewed in TypeScript files. Claude loads it on its own when the description matches the file or the task; it never writes anything itself. It matches:

The conventions

throw new AppError("...", { cause: err })

{ok:true,data}|{ok:false,error}

{ error: { code, message, details? } }