Skip to content

Commit

Permalink
add try/catch around getGasPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Dec 4, 2024
1 parent a8bfdc7 commit 456ac82
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,14 @@ export class Executor {
): Promise<ReplaceTransactionResult> {
const newRequest = { ...transactionInfo.transactionRequest }

const gasPriceParameters =
await this.gasPriceManager.getNetworkGasPrice()
let gasPriceParameters
try {
gasPriceParameters = await this.gasPriceManager.getNetworkGasPrice()
} catch (err) {
this.logger.error({ error: err }, "Failed to get network gas price")
this.markWalletProcessed(transactionInfo.executor)
return { status: "failed" }
}

newRequest.maxFeePerGas = maxBigInt(
gasPriceParameters.maxFeePerGas,
Expand Down

0 comments on commit 456ac82

Please sign in to comment.