Skip to content

Commit

Permalink
Merge branch '126-exception-handling-in-verify-event' into 'dev'
Browse files Browse the repository at this point in the history
rethrow any errors while verifying events

Closes #126

See merge request ergo/rosen-bridge/rosen-chains!155
  • Loading branch information
zargarzadehm committed Nov 25, 2024
2 parents 817d526 + 7528e4a commit 4986335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-turkeys-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rosen-chains/abstract-chain': patch
---

Rethrow any unexpected errors while verifying events
9 changes: 1 addition & 8 deletions packages/abstract-chain/lib/AbstractChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,8 @@ abstract class AbstractChain<TxType> {
`Event [${eventId}] is not valid, lock tx [${event.sourceTxId}] is not available in network`
);
return false;
} else if (
e instanceof FailedError ||
e instanceof NetworkError ||
e instanceof UnexpectedApiError
) {
throw Error(`Skipping event [${eventId}] validation: ${e}`);
} else {
this.logger.warn(`Event [${eventId}] validation failed: ${e}`);
return false;
throw Error(`Skipping event [${eventId}] validation: ${e}`);
}
}
};
Expand Down

0 comments on commit 4986335

Please sign in to comment.