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.
This commit is contained in:
Jonas Jenwald 2020-09-23 14:11:45 +02:00
parent 120c5c2261
commit 7b15094cdf

View File

@ -13,6 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
import { RenderingCancelledException } from "pdfjs-lib";
const CLEANUP_TIMEOUT = 30000; const CLEANUP_TIMEOUT = 30000;
const RenderingStates = { const RenderingStates = {
@ -170,6 +172,9 @@ class PDFRenderingQueue {
this.renderHighestPriority(); this.renderHighestPriority();
}) })
.catch(reason => { .catch(reason => {
if (reason instanceof RenderingCancelledException) {
return;
}
console.error(`renderView: "${reason}"`); console.error(`renderView: "${reason}"`);
}); });
break; break;