Skip to content

Commit

Permalink
Update error.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Nov 6, 2024
1 parent 5453c08 commit 3a0994e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function errorSnapshot(header: string, err: any): string {
* Checks if a viem BaseError is from eth node, copied from
* "viem/_types/utils/errors/getNodeError" since not a default export
*/
export function containsNodeError(err: BaseError) {
export function containsNodeError(err: BaseError): boolean {
return (
err instanceof TransactionRejectedRpcError ||
err instanceof InvalidInputRpcError ||
Expand All @@ -68,7 +68,8 @@ export function containsNodeError(err: BaseError) {
err instanceof IntrinsicGasTooLowError ||
err instanceof TransactionTypeNotSupportedError ||
err instanceof TipAboveFeeCapError ||
(err instanceof RpcRequestError && err.code === ExecutionRevertedError.code)
(err instanceof RpcRequestError && err.code === ExecutionRevertedError.code) ||
("cause" in err && containsNodeError(err.cause as any))
// ("code" in err && err.code === ExecutionRevertedError.code)
);
}

0 comments on commit 3a0994e

Please sign in to comment.