Skip to content

Conversation

@redpandatronicsuk
Copy link

Now error can be used in catch block that handles the error

Now error can be used in catch block that handles the error
@msaaddev msaaddev self-requested a review September 28, 2021 16:58
@msaaddev
Copy link
Owner

msaaddev commented Sep 28, 2021

@redpandatronicsuk thanks for the PR. I see you are passing the error in the reject. If you take a look on the line before reject, you will see that I am using a function called handleError. This function actually extracts all the useful part of the error, format it, and then show it to the user. If we pass the error in reject as well, it is going to show a duplicate error if the user logs it in the catch. One formatted and the other non-formatted.

@msaaddev
Copy link
Owner

But I think your approach is better and is more general. Would you mind editing the PR and remove the handleError part as well as removing the dependency?

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