Skip to content
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

improve errors handling #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliancwirko
Copy link
Contributor

There could be a better way to improve that. Maybe on the message event listeners' side, but this change makes the errors more readable.

  1. Change the main message to 'Transaction failed' instead of 'Transaction canceled,' which is more general
  2. Spread the try catch also for startBgrMsgChannel Promise
  3. Catch the extensionResponse when it is not an array of transactions. When someone cancels the process.

Instead:

Transaction canceled: extensionResponse.map is not a function.

We now have:

Transaction failed: CanceledError.

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.

1 participant