feat: catch and store async promise error#960
Merged
pedroferreira1 merged 4 commits intomasterfrom Oct 27, 2025
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #960 +/- ##
=======================================
Coverage 84.76% 84.76%
=======================================
Files 112 112
Lines 8079 8088 +9
Branches 1731 1733 +2
=======================================
+ Hits 6848 6856 +8
- Misses 1203 1204 +1
Partials 28 28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tuliomir
previously approved these changes
Oct 27, 2025
src/wallet/wallet.ts
Outdated
| const walletId = HathorWalletServiceWallet.getWalletIdFromXPub(xpub); | ||
| this.walletId = walletId; | ||
| renewPromise2 = this.validateAndRenewAuthToken(pinCode); | ||
| renewPromise2 = this.validateAndRenewAuthToken(pinCode).catch(err => { |
Contributor
There was a problem hiding this comment.
suggestion: Use another name for this variable, as a parent has already declared err
Suggested change
| renewPromise2 = this.validateAndRenewAuthToken(pinCode).catch(err => { | |
| renewPromise2 = this.validateAndRenewAuthToken(pinCode).catch(renew2err => { |
andreabadesso
previously approved these changes
Oct 27, 2025
185f241
andreabadesso
approved these changes
Oct 27, 2025
tuliomir
approved these changes
Oct 27, 2025
r4mmer
added a commit
that referenced
this pull request
Dec 11, 2025
…-policy * origin/master: (31 commits) feat: fee token creation (#858) fix: checkAddressMine was crashing when called with an empty array (#977) feat: the nano amount field should accept 0 Merge pull request #975 from HathorNetwork/chore/bump-v2.11.0 feat: add nano execution logs API (#973) Refactor: Fullnode facade to Typescript (#972) Merge pull request #970 from HathorNetwork/chore/bump-v2.10.0 fix: added missing tx proposal delete schema (#969) feat: add missing api calls for graphviz and nano (#967) Merge pull request #965 from HathorNetwork/feat/complete-token-info-object chore: bump package to v2.9.1 (#962) feat: catch and store async promise error (#960) chore: bump wallet lib to v2.9.0 (#958) tests: use core v0.67.0 docker image for the integration tests (#956) tests: update integration tests blueprints for the new core sdk (#954) fix: added a minimal accessData so methods that need storage don't crash (#955) feat: fee header (#951) feat: added read-only start (#950) fix: dont add metadata changed for voided txs (#948) test: Wallet Service infrastructure (#909) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The renew token promises are not awaited directly, so if they fail before reaching the await, we get an unhandled promise. The snap code was crashing the request with this unhandled promise.
Using an empty
catchfor each promise would do just fine for the snap code to work but in the end we await the promise and have atry...catchblock, which wouldn't work, if we didn't store the error that could have happened before the await.Acceptance Criteria