Not respecting `--unhandled-rejections=strict`
See original GitHub issue-
What version of bluebird is the issue happening on? 3.7.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:
- Created 3 years ago
- Comments:10
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
useunhandledRejection
) 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.Thanks, I’m closing it.