Skip to content

fix: Improve error handling and add await for async mapping in transaction-info.mapper #2653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

PooyaRaki
Copy link
Contributor

Summary

This PR resolves an issue where transaction history was being blocked due to decoding errors in Bridge/Swap operations. Instead of throwing an exception that halts the process, the error is now logged to allow the flow to continue gracefully. Additionally, the mapSwap method call has been updated with the await keyword to ensure proper asynchronous handling, which helps in capturing and managing errors effectively.

Changes

  • Updated error handling to log errors as critical instead of throwing them directly which breaks the transaction flow.
  • Added 'await' keyword to the mapSwap method call to ensure proper asynchronous execution and error handling.

…ction-info.mapper

- Updated error handling to log errors as critical instead of throwing them directly which breaks the transaction flow.
- Added 'await' keyword to the mapSwap method call to ensure proper asynchronous execution and error handling.
@PooyaRaki PooyaRaki marked this pull request as ready for review July 17, 2025 15:57
@PooyaRaki PooyaRaki requested a review from a team as a code owner July 17, 2025 15:57
@PooyaRaki PooyaRaki requested review from compojoom and tmjssz July 17, 2025 15:58
@@ -131,7 +131,7 @@ export class MultisigTransactionInfoMapper {
if (error instanceof NotFoundException) {
this.loggingService.warn(error);
} else {
throw error;
this.loggingService.error(error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but what are we then mapping below if we have an exception here? why is the code afterwards not throwing exceptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapper checks the type of the TX and tries to map accordingly, but in case no type is found to map, it returns it as a custom transaction:

return this.customTransactionMapper.mapCustomTransaction(

@PooyaRaki PooyaRaki requested a review from compojoom July 18, 2025 10:03
@PooyaRaki PooyaRaki merged commit 23ff5a9 into main Jul 18, 2025
29 of 31 checks passed
@PooyaRaki PooyaRaki deleted the fix/bridgeIssue branch July 18, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants