@@ -38,6 +38,7 @@ import {
3838 isNonceAlreadyUsedError ,
3939 isReplacementGasFeeTooLow ,
4040 prettifyError ,
41+ wrapError ,
4142} from "../../utils/error" ;
4243import { getChecksumAddress } from "../../utils/primitiveTypes" ;
4344import { recordMetrics } from "../../utils/prometheus" ;
@@ -249,7 +250,7 @@ const _sendUserOp = async (
249250 return {
250251 ...queuedTransaction ,
251252 status : "errored" ,
252- errorMessage : prettifyError ( e , "Bundler" ) ,
253+ errorMessage : wrapError ( e , "Bundler" ) . message ,
253254 } satisfies ErroredTransaction ;
254255 }
255256
@@ -326,7 +327,7 @@ const _sendTransaction = async (
326327 return {
327328 ...queuedTransaction ,
328329 status : "errored" ,
329- errorMessage : prettifyError ( e , "RPC" ) ,
330+ errorMessage : wrapError ( e , "RPC" ) . message ,
330331 } satisfies ErroredTransaction ;
331332 }
332333
@@ -380,7 +381,7 @@ const _sendTransaction = async (
380381 const gasPrice =
381382 populatedTransaction . gasPrice ?? populatedTransaction . maxFeePerGas ;
382383
383- let errorMessage = prettifyError ( e , "RPC" ) ;
384+ let errorMessage = prettifyError ( e ) ;
384385 if ( gasPrice ) {
385386 const { gas, value = 0n } = populatedTransaction ;
386387 const { name, nativeCurrency } = await getChainMetadata ( chain ) ;
@@ -394,7 +395,7 @@ const _sendTransaction = async (
394395 } satisfies ErroredTransaction ;
395396 }
396397
397- throw prettifyError ( e , "RPC" ) ;
398+ throw wrapError ( e , "RPC" ) ;
398399 }
399400
400401 await addSentNonce ( chainId , from , nonce ) ;
@@ -480,7 +481,7 @@ const _resendTransaction = async (
480481 job . log ( "A pending transaction exists with >= gas fees. Do not resend." ) ;
481482 return null ;
482483 }
483- throw error ;
484+ throw wrapError ( error , "RPC" ) ;
484485 }
485486
486487 return {
0 commit comments