We have
function blah(done) {
doSomething(function(err, data) {
if (err) return done(err);
var x = JSON.parse(data);
doOtherThings();
done(null, x);
});
}
If we run this in a domain and JSON.parse
throws, our process continues.
If we run this in a promise and JSON.parse
throws, the process crashes.