mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Dump the stack with unhandled rejections.
This commit is contained in:
parent
029b970871
commit
97a40252dc
1 changed files with 6 additions and 2 deletions
|
@ -770,8 +770,12 @@ var Promise = PDFJS.Promise = (function PromiseClosure() {
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
for (var i = 0; i < this.unhandledRejections.length; i++) {
|
for (var i = 0; i < this.unhandledRejections.length; i++) {
|
||||||
if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) {
|
if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) {
|
||||||
warn('Unhandled rejection: ' +
|
var unhandled = this.unhandledRejections[i].promise._value;
|
||||||
this.unhandledRejections[i].promise._value);
|
var msg = 'Unhandled rejection: ' + unhandled;
|
||||||
|
if (unhandled.stack) {
|
||||||
|
msg += '\n' + unhandled.stack;
|
||||||
|
}
|
||||||
|
warn(msg);
|
||||||
this.unhandledRejections.splice(i);
|
this.unhandledRejections.splice(i);
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue