question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Async matcher does not handle rejections

See original GitHub issue

Rejections thrown by async matchers are not handled correctly. They end up as Uncaught (in Promise) type errors

To reproduce this:

  • go to https://zxcvbn-ts.github.io/zxcvbn/demo/
  • In the chrome developer toolbar, disable your internet connection
  • Type something in the password field
  • You’ll notice the uncaught errors popping up in the developer toolbar

err

Not having a proper mechanism for error handling means that we cannot use things like the pnwd matcher in production

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
MrWookcommented, Jul 27, 2022

I thought about a config parameter too but this is a bit tricky so first let’s get rid of the major issue and than make it better 👍

0reactions
LaurensRietveldcommented, Jul 27, 2022

Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elegantly Handling Reject on `await`ed Javascript Promise
The following won't work because const is block scoped: async function () { try { const result = await get_session() } catch (err)...
Read more >
Jest gives no indication that test fails because of unhandled ...
When Jest fails a test for what it thinks - wrongly - is an unhandled rejection, it does not indicate this at all....
Read more >
Handling those unhandled promise rejections with JS async ...
… by rejecting a promise which was not handled with .catch(). The solution is simple, either use .catch() as suggested by the message:...
Read more >
Promise rejections from signal handlers are silent (#417)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >
Testing promise rejection in JavaScript with Jest - Codeleak.pl
It looks like using try-catch with async/await is the easiest way to achieve this as the rejected value is thrown: it("rejects (bad)", async...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found