Skip to content

Commit 3f8859f

Browse files
committed
fix: do not fall through on execution errors
1 parent fe558fd commit 3f8859f

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

.changeset/four-beans-tan.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"viem": patch
3+
---
4+
5+
Fixed issue where Transports were falling back on execution errors.

pnpm-lock.yaml

+28-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/clients/transports/fallback.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ExecutionRevertedError } from '../../errors/node.js'
12
import {
23
TransactionRejectedRpcError,
34
UserRejectedRequestError,
@@ -195,6 +196,7 @@ function shouldThrow(error: Error) {
195196
if (
196197
error.code === TransactionRejectedRpcError.code ||
197198
error.code === UserRejectedRequestError.code ||
199+
ExecutionRevertedError.nodeMessage.test(error.message) ||
198200
error.code === 5000 // CAIP UserRejectedRequestError
199201
)
200202
return true

0 commit comments

Comments
 (0)