Free email newsletter: “ES.next News

2016-04-17

Trees of Promises in ES6

This blog post shows how to handle trees of ES6 Promises, via an example where the contents of a directory are listed asynchronously.

2016-04-12

Tracking unhandled rejected Promises

In Promise-based asynchronous code, rejections are used for error handling. One risk is that rejections may get lost, leading to silent failures. For example:

    function main() {
        asyncFunc()
        .then(···)
        .then(() => console.log('Done!'));
    }

If asyncFunc() rejects the Promise it returns then that rejection will never be handled anywhere.

Let’s look at how you can track unhandled rejections in browsers and in Node.js.