You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code uses CPS-style but it's within a promise chain.
The errors thrown are inside callbacks, hence they will never be returned up the promise chain.
mkdirp(path.dirname(dest), function(err) {
if (err) {
// this has no effect on the promise chain, since it's inside a callback
throw err;
}
fs.writeFile(dest, html, 'utf8', function(err) {
if (err) {
// this has no effect on the promise chain, since it's inside a callback
throw err;
}
});
});
Also, the following handling at the end will log errors from the promise chain, but will not allow them to propogate:
.catch(function(err) {
if (err) {
console.error(err.stack);
}
});
The text was updated successfully, but these errors were encountered:
From:
lib/generate.js
The following code uses CPS-style but it's within a promise chain.
The errors thrown are inside callbacks, hence they will never be returned up the promise chain.
Also, the following handling at the end will log errors from the promise chain, but will not allow them to propogate:
The text was updated successfully, but these errors were encountered: