3 ms·
This has been my biggest pain point with Promises, I have spent hours trying to debug an issue only to find out I hadn't used an error handler in a Promise some
by prawnsalad 11y ago
This has been my biggest pain point with Promises, I have spent hours trying to debug an issue only to find out I hadn't used an error handler in a Promise somewhere and an error was being thrown. It is so frustrating.
I know some Promise libraries have an option to report unhandled errors which makes life a lot easier but there really should be something natively too.
- inglor 11y agoprocess.on('unhandledRejection', function(promise,reason) {` since io.js 1.3
- bsimpson 11y agoI haven't looked at io.js in a short while. Does it log to console.error by default (like Chrome now does)? This mistake is going to be most frustrating for those who don't realize that "unhandledRejection" is a case they even need to consider. People learning JS and having nothing happen when they run (erroneous) code are going to be pulling their hair out.
- inglor 11y agoThis is currently being discussed in io.js (and remember it's being backported to the main NodeJS branch). Feel free to come participate in the discussion.