Merge pull request #3549 from brendandahl/uhandled-stack
Dump the stack with unhandled rejections.
This commit is contained in:
commit
44184a1d5b
@ -770,8 +770,12 @@ var Promise = PDFJS.Promise = (function PromiseClosure() {
|
||||
var now = Date.now();
|
||||
for (var i = 0; i < this.unhandledRejections.length; i++) {
|
||||
if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) {
|
||||
warn('Unhandled rejection: ' +
|
||||
this.unhandledRejections[i].promise._value);
|
||||
var unhandled = this.unhandledRejections[i].promise._value;
|
||||
var msg = 'Unhandled rejection: ' + unhandled;
|
||||
if (unhandled.stack) {
|
||||
msg += '\n' + unhandled.stack;
|
||||
}
|
||||
warn(msg);
|
||||
this.unhandledRejections.splice(i);
|
||||
i--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user