> But Promises already provide asynchronous try/catch blocks
They do, if all you use is modules that return promises, and the node ecosystem currently has many modules that don't. For example:
zone.create(function MyZone() {
// Within MyZone
setTimeout(function() {
// Within MyZone
throw new Error("Oh noes!");
});
}).catch(function(err) {
// Back in the parent zone.
// Handle the error here.
});
The above won't work with promises unless you use a promisified version of setTimeout and return that promise from the constructor function.Conversely, with zones, chaining callbacks is hard to define conceptually:
zone.create(function MyZone() {
// In MyZone
}).then(function() {
// Which zone are we in?
}).then(function() {
// Which zone are we in?
});
But if you have a great idea here, bring it on.