Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 1634467

Browse files
author
Thomas Grainger
committed
Add traceback to unhandled promise rejections
1 parent d08e319 commit 1634467

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ng/q.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
381381
if (!toCheck.pur) {
382382
toCheck.pur = true;
383383
var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);
384-
exceptionHandler(errorMessage);
384+
if (toCheck.value instanceof Error) {
385+
exceptionHandler(toCheck.value, errorMessage);
386+
} else {
387+
exceptionHandler(errorMessage);
388+
}
385389
}
386390
}
387391
}

0 commit comments

Comments
 (0)