mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #3549 from brendandahl/uhandled-stack
Dump the stack with unhandled rejections.
This commit is contained in:
commit
44184a1d5b
1 changed files with 6 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue