From 028d7c09508b736f2dec49ef61e7f7f891082424 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 28 Aug 2017 13:49:40 +0200 Subject: [PATCH] Ensure that `PDFViewerApplication.error` outputs proper messages in FIREFOX/MOZCENTRAL builds *It appears that this accidentally broke with PR 8394.* Currently, the following will be printed in the console: ``` An error occurred while loading the PDF. [object Promise],[object Promise] ``` With this patch we'll again get proper output, e.g. something with this format: ``` An error occurred while loading the PDF. PDF.js v? (build: ?) Message: unknown encryption method ``` --- web/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index 95bbc88b6..99103b77e 100644 --- a/web/app.js +++ b/web/app.js @@ -841,7 +841,9 @@ let PDFViewerApplication = { errorMoreInfo.value = parts.join('\n'); }); } else { - console.error(message + '\n' + moreInfoText); + Promise.all(moreInfoText).then((parts) => { + console.error(message + '\n' + parts.join('\n')); + }); this.fallback(); } },