From 9a4d14bf36afd4d69a8f649e7f98441b26ef0548 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 11 Jul 2019 11:44:49 +0200 Subject: [PATCH] Prevent "Uncaught promise" messages in the console when cancelling `TextLayer` tasks (PR 10601 follow-up) Since `finally` won't stop error propagation, this causes unnecessary messages to be printed in the console whenever a `TextLayer` task is cancelled. --- src/display/text_layer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 27f27d02e..d0d58379d 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -500,7 +500,7 @@ var renderTextLayer = (function renderTextLayerClosure() { this._layoutTextCtx.canvas.height = 0; this._layoutTextCtx = null; } - }); + }).catch(() => { /* Avoid "Uncaught promise" messages in the console. */ }); } TextLayerRenderTask.prototype = { get promise() {