بنقرة واحدة
error-handling
// Use when throwing, catching, wrapping, documenting, or testing runtime errors in aa-sdk packages.
// Use when throwing, catching, wrapping, documenting, or testing runtime errors in aa-sdk packages.
Use when changing GitHub workflows, Lerna versioning, package publish, or post-merge docs hooks (revalidate + SDK indexer).
Use when writing or modifying Vitest tests, `.vitest` setup, Anvil/Foundry or Rundler fixtures, per-package test config, or CI affected-test behavior.
Use when changing package management, workspace config, build scripts, generated outputs, Turborepo/Lerna config, or local validation in aa-sdk.
Use when editing `docs/**/*.mdx`, generated reference docs, TypeDoc comments, `typedoc.json`, `docs/docs.yml`, or documentation review instructions.
Use when changing package entry points, `exports` maps, public API barrels, import paths, or subpath exports in aa-sdk packages.
Use when changing `packages/smart-accounts`, account implementations, modules, permissions, nonces, deferred actions, or account address helpers.
| name | error-handling |
| description | Use when throwing, catching, wrapping, documenting, or testing runtime errors in aa-sdk packages. |
| last_verified | "2026-05-06T00:00:00.000Z" |
Runtime package errors should use the SDK error hierarchy rooted at
@alchemy/common BaseError.
| Rule | When to read |
|---|---|
| BaseError | Before adding package runtime errors. |
| No plain Error | Before writing throw statements in packages/. |
| Raise footgun | Before using or modifying raise. |
packages/common/src/errors/BaseError.ts extends viem's BaseError..eslintrc forbids throw new Error(...) in packages/**/* except tests..eslintrc forbids import { BaseError } from "viem" to prevent accidentally
using viem's BaseError instead of @alchemy/common's.packages/wallet-apis/src/utils/schema.ts wraps Zod validation failures in
@alchemy/common BaseError.