Skip to content

Commit

Permalink
Merge pull request #153 from harmony-one/handle_not_mined_error
Browse files Browse the repository at this point in the history
Handle not mined error
  • Loading branch information
theofandrich authored Aug 22, 2023
2 parents 68b7373 + 6ad250a commit c5119b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/modules/payment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ export class BotPayments {
return tx;
} catch (e) {
const message = (e as Error).message || ''
if(message && message.includes('replacement transaction underpriced')) {
if(message &&
(message.includes('replacement transaction underpriced')
|| message.includes('was not mined within')
|| message.includes('Failed to check for transaction receipt')
)
) {
// skip this error
this.logger.warn(`Skip error: ${message}`)
} else {
throw new Error(message)
}
Expand Down

0 comments on commit c5119b8

Please sign in to comment.