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.

Not respecting `--unhandled-rejections=strict`

See original GitHub issue
  1. What version of bluebird is the issue happening on? 3.7.2

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32) Node v14.5.0

Running following code:

setTimeout(() => console.log('not executed'), 1000)

const rejected = new Promise((res, rej) => {
  rej(new Error('error'))
})

with node’s native promise and cli option --unhandled-rejections=strict will terminate the script on unhandled rejection.

But when using Bluebirds promise, it will not.

const { Promise } = require('bluebird')

setTimeout(() => console.log('will be executed!'), 1000)

const rejected = new Promise((res, rej) => {
  rej(new Error('error'))
})

It seems that --unhandled-rejections=strict is ignored

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
benjamingrcommented, Aug 22, 2020

9 out of 10 times the hard part is figuring out what to do and not the code change itself. The code change is trivial (just make strict use unhandledRejection) whereas figuring out if it’s worth the breaking change is definitely not clear cut.

Honestly I think it makes sense to delay this covnersation a few months in case the survey results indicate that strict will be the default anyway.

1reaction
misozaskcommented, Aug 19, 2020

Thanks, I’m closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

unhandled-rejections=strict flag · Issue #41184 · nodejs/node ...
when we use flag --unhandled-rejections=strict we expect not to see any UnhandledPromiseRejectionWarning and Raise the unhandled rejection ...
Read more >
Probleme with javascript error (--unhandled-rejections=strict)
i'm learning javascript and i'm stuck with the following error: --unhandled-rejections = strict i'm breaking my head i can't get by. here is ......
Read more >
How to get --unhandled-rejections=strict working (Node.js)
Node.js has a CLI option called --unhandled-rejections=strict , which causes the script to completely fail instead of just throwing a ...
Read more >
Node.js 15 release: Updated handling of rejections, npm 7, N ...
To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see ...
Read more >
Process | Node.js v19.3.0 Documentation
The 'unhandledRejection' event is emitted whenever a Promise is rejected and no error handler is attached to the promise within a turn of...
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