-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Use more user friendly errors when choosing default fund for Wallet #7929
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7f81c79
Add the error messages to CONST
mountiny 7596e3c
Handle the specific errors in setWalletLinkedAccount action and add e…
mountiny c1fcfe3
Move the error handling to catch
mountiny e468caf
Remove the translation key from es.js
mountiny 6fde654
Fix style errors
mountiny b31a27d
Merge branch 'main' into vit-improveWalletErrors
mountiny 5bb9ffd
Update the copies
mountiny eb83cb6
Remove the ambiguous error message and use the default one
mountiny 4d14ac6
Resolve merge conflict with the translations
mountiny b8a61bc
Update the copy again and reduce the number of error messages
mountiny 4340851
Merge branch 'main' into vit-improveWalletErrors
mountiny 42c161f
Add the Spanish translations
mountiny fe66a08
Fix lint issues
mountiny d1fdfa6
Use String literals
mountiny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone know if it's possible for this API command promise method to land in this
.catch()block?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exception is thrown and where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I think it's this weird code here that I am removing 😄
App/src/libs/API.js
Lines 182 to 187 in c26e415
I think most errors do not work this way and
catch()should never do anything. No worries though just in the process of cleaning some stuff up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is this one which we decided not to catch specifically as it should not happen but if it happens, the error message would need to be very general as the default already was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thanks I would like to know where the exception gets thrown in the JavaScript layer.
This issue has more details: https://github.com/Expensify/Expensify/issues/201109
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, I have first tried to handle it in the
thencase but it did not work for me,catchdid. Not sure now why that is happening. Catch worked locally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for the context! 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's because the promise is getting rejected which will trigger the
.catch()block and would be similar to throwing an exception inside the.then()block. Kind of weird IMO because who knows how many API can throw these codes (or which may throw them in the future) and any that are not handled like you did here will crash the app.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that is weird indeed. We should standardize this for sure.