Promise Me Not

Promises errors are sometimes described as a pit of despair mechanism.

What does it mean? It means that by default, promise chains swallow errors.

What does it mean (again)? I means that If you have an error thrown somewhere in your code, your promise will catch it and if you did not tell your promise to specifically do something, the promise won’t report the error. You won’t ever know you have an error in your code.

Surprise! This “pit of despair” behaviour is fixed in recent versions of node.

Here is the same code but evaluated in your browser.
If you open you console / devtools you will be able to check what’s the behaviour of your current web browser. If you see an error in your browser console that’s good!

So promises used to have a pit of despair behaviour with error handling and this is being fixed.
Be aware you can see different behaviours with different environments. The es6 spec still specifies that uncaught errors should be swallowed. But NodeJs and browsers environements have implemented changes to address this developer pain point.