Skip to content

Three error classes pass a name that contradicts their class and alias - #5524

Merged
jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/error-name-suffix
Nov 16, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/error-name-suffix

Conversation

@mortezashojaei

Copy link
Copy Markdown
Contributor

Problem

The house shape is export type FooErrorType = FooError & { name: 'FooError' } directly above export class FooError, with super(...) passing name: 'FooError'. Three classes pass an abbreviated name that drops the Error suffix while the alias above them declares the full name, so the declared type lies about the runtime name and err.name comparisons against the documented class name fail. TypeScript accepts both spellings, so only review catches it.

  • src/errors/abi.ts
  • src/errors/transaction.ts

How this was validated

src/errors/abi.ts:453-463 declares InvalidAbiEncodingTypeErrorType & { name: 'InvalidAbiEncodingTypeError' } but the constructor passes { docsPath, name: 'InvalidAbiEncodingType' }; src/errors/abi.ts:468-478 does the same for InvalidAbiDecodingTypeError -> 'InvalidAbiDecodingType'; src/errors/transaction.ts:114-124 does the same for InvalidSerializedTransactionTypeError -> 'InvalidSerializedTransactionType'. The inline snapshots confirm the runtime names (src/errors/abi.test.ts:53,207, src/errors/transaction.test.ts:73 all read [InvalidAbiEncodingType: ...]), and site/pages/docs/glossary/errors.md:28,29,154 document the ...Error names. The rest of the 192 BaseError subclasses either match or use a deliberate namespace prefix, and 0fee300f5 fixed exactly this class of bug in src/errors/typedData.ts, so the convention is live.

Set the documented name on InvalidAbiEncodingTypeError, InvalidAbiDecodingTypeError, and InvalidSerializedTransactionTypeError so their ErrorType aliases match the runtime name, and update the affected snapshots.
@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown

@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fca76e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jxom
jxom merged commit 10d4ee2 into wevm:main Nov 16, 2026
28 of 35 checks passed
This was referenced Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants