From 7b15094cdfdc56b1e8d932b1a8c9811e5fab2823 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 23 Sep 2020 14:11:45 +0200 Subject: [PATCH] Ignore `RenderingCancelledException` when logging errors in `PDFRenderingQueue.renderView` Note that a `RenderingCancelledException` *should* never actually reach this method, but better safe than sorry I suppose, considering that both `PDFPageView` and `PDFThumbnailView` are already catching `RenderingCancelledException`s since those are *not* Errors in the normal sense of the word. --- web/pdf_rendering_queue.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/pdf_rendering_queue.js b/web/pdf_rendering_queue.js index 444f1cb01..64b377dd2 100644 --- a/web/pdf_rendering_queue.js +++ b/web/pdf_rendering_queue.js @@ -13,6 +13,8 @@ * limitations under the License. */ +import { RenderingCancelledException } from "pdfjs-lib"; + const CLEANUP_TIMEOUT = 30000; const RenderingStates = { @@ -170,6 +172,9 @@ class PDFRenderingQueue { this.renderHighestPriority(); }) .catch(reason => { + if (reason instanceof RenderingCancelledException) { + return; + } console.error(`renderView: "${reason}"`); }); break;