Skip to content

Two error classes never pass name to super, and one ErrorType alias points at the wrong class - #5494

Merged
jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/error-names-and-alias
Nov 11, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:fix/error-names-and-alias

Conversation

@mortezashojaei

Copy link
Copy Markdown
Contributor

Problem

InvalidDomainError and InvalidPrimaryTypeError declare ErrorType aliases asserting name: 'InvalidDomainError' / name: 'InvalidPrimaryTypeError', but their super(...) calls pass only metaMessages/docsPath. BaseError therefore keeps its default name = 'BaseError', and the declared alias name is wrong at runtime. Separately, TxHashNotFoundInLogsErrorType is built from BaseFeeHigherThanValueError instead of TxHashNotFoundInLogsError, so the alias describes the wrong class.

  • src/errors/typedData.ts
  • src/zksync/errors/bridge.ts

How this was validated

Of 188 export class *Error extends BaseError declarations outside tests, 185 pass an explicit name: in the super options; the three exceptions are src/tempo/Gateway.ts:336 (RequestError, which deliberately forwards options.name ?? 'Gateway.RequestError') plus src/errors/typedData.ts:9-15 and :20-34, whose neighbouring aliases at :6-8 and :17-19 claim a name the class never sets. src/errors/base.ts:74 shows the class only uses args.name ?? this.name with field default 'BaseError'. Alias/class name matching holds for 176 of 184 distinct exported error classes; the mismatch at src/zksync/errors/bridge.ts:21-23 names BaseFeeHigherThanValueError where the class declared at :32 is TxHashNotFoundInLogsError (compare the correct shape at :32-34).

Pass explicit name options in InvalidDomainError and InvalidPrimaryTypeError so their ErrorType aliases match runtime names, and build TxHashNotFoundInLogsErrorType from TxHashNotFoundInLogsError.
@vercel

vercel Bot commented Nov 11, 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 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ad973fb

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 0fee300 into wevm:main Nov 11, 2026
28 of 35 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 11, 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