Skip to content

Commit

Permalink
Add events for timeout and error
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrawlings committed Oct 7, 2016
1 parent 4646eef commit 6496fb6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions taglibs/async/await-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ module.exports = function render(input, out) {
}

if (err) {
awaitInfo.error = err;
out.emit('await:error', awaitInfo);
if (input.renderError) {
console.error('Await (' + name + ') failed. Error:', (err.stack || err));
input.renderError(targetOut);
} else {
targetOut.error(err);
}
} else if (renderTimeout) {
awaitInfo.timedout = true;
out.emit('await:timeout', awaitInfo);
renderTimeout(targetOut);
} else {
if (input.renderBody) {
Expand Down

0 comments on commit 6496fb6

Please sign in to comment.