1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #19148 from nicolo-ribaudo/error-preserve-trace

Do not stringify errors when logging them
This commit is contained in:
Jonas Jenwald 2024-12-06 17:11:33 +01:00 committed by GitHub
commit c198e0b446
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 21 additions and 20 deletions

View file

@ -204,7 +204,7 @@ const PDFViewerApplication = {
try {
await this.preferences.initializedPromise;
} catch (ex) {
console.error(`initialize: "${ex.message}".`);
console.error("initialize:", ex);
}
if (AppOptions.get("pdfBugEnabled")) {
await this._parseHashParams();
@ -308,7 +308,7 @@ const PDFViewerApplication = {
await __non_webpack_import__(PDFWorker.workerSrc);
}
} catch (ex) {
console.error(`_parseHashParams: "${ex.message}".`);
console.error("_parseHashParams:", ex);
}
}
if (params.has("textlayer")) {
@ -324,7 +324,7 @@ const PDFViewerApplication = {
await loadPDFBug();
this._PDFBug.loadCSS();
} catch (ex) {
console.error(`_parseHashParams: "${ex.message}".`);
console.error("_parseHashParams:", ex);
}
break;
}
@ -337,7 +337,7 @@ const PDFViewerApplication = {
await loadPDFBug();
this._PDFBug.init(mainContainer, enabled);
} catch (ex) {
console.error(`_parseHashParams: "${ex.message}".`);
console.error("_parseHashParams:", ex);
}
}
// It is not possible to change locale for the (various) extension builds.
@ -1128,7 +1128,7 @@ const PDFViewerApplication = {
this.downloadManager.download(data, this._downloadUrl, this._docFilename);
} catch (reason) {
// When the PDF document isn't ready, fallback to a "regular" download.
console.error(`Error when saving the document: ${reason.message}`);
console.error(`Error when saving the document:`, reason);
await this.download();
} finally {
await this.pdfScriptingManager.dispatchDidSave();