Skip to content

Commit

Permalink
Fix stack trace of errors that has been thrown when the work queue ha…
Browse files Browse the repository at this point in the history
…s been drained
  • Loading branch information
sunesimonsen committed Jul 26, 2015
1 parent ec60802 commit f714a6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/oathbreaker.js
Expand Up @@ -43,6 +43,9 @@ module.exports = function oathbreaker(value) {
workQueue.drain();

if (evaluated && error) {
if (Error.captureStackTrace) {
Error.captureStackTrace(error);
}
throw error;
} else if (evaluated) {
return value;
Expand Down

0 comments on commit f714a6a

Please sign in to comment.