Skip to content

Commit

Permalink
remove chaining and use try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
JSHan94 committed Dec 26, 2023
1 parent 0273865 commit 0341818
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bots/src/worker/bridgeExecutor/Resurrector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ export class Resurrector {
failedTx.l1Height,
Buffer.from(failedTx.data, 'hex').toString('base64')
);

await this.executor.transaction([msg]).catch(async (_) => {
try {
await this.executor.transaction([msg])
await this.updateProcessed(failedTx);
} catch (err) {
if (this.errorCounter++ < 20) {
await Bluebird.delay(5 * 1000);
return;
}
this.errorCounter = 0;
await notifySlack(buildFailedTxNotification(failedTx));
});
await this.updateProcessed(failedTx);
}
}

async getFailedTxs(): Promise<FailedTxEntity[]> {
Expand Down

0 comments on commit 0341818

Please sign in to comment.