From 711040ecc57fbf7aac1f60d1ade865aee348f245 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 19 Aug 2019 13:02:52 +0200 Subject: [PATCH] Stop re-throwing errors in the 'GetOperatorList' and 'GetTextContent' handlers, in `src/core/worker.js` These functions aren't returning anything, now that they're using `ReadableStream`s, and it thus doesn't seem necessary to re-throw errors (also given the console message that's caused by it). --- src/core/worker.js | 8 ++++++-- test/unit/api_spec.js | 5 ----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/worker.js b/src/core/worker.js index e662bb65a..6c74352b3 100644 --- a/src/core/worker.js +++ b/src/core/worker.js @@ -501,7 +501,9 @@ var WorkerMessageHandler = { { featureId: UNSUPPORTED_FEATURES.unknown, }); sink.error(reason); - throw reason; + + // TODO: Should `reason` be re-thrown here (currently that casues + // "Uncaught exception: ..." messages in the console)? }); }); }, this); @@ -538,7 +540,9 @@ var WorkerMessageHandler = { return; // ignoring errors from the terminated thread } sink.error(reason); - throw reason; + + // TODO: Should `reason` be re-thrown here (currently that casues + // "Uncaught exception: ..." messages in the console)? }); }); }); diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index 35da45481..2a2c18de2 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -1281,11 +1281,6 @@ describe('api', function() { it('gets operatorList, from corrupt PDF file (issue 8702), ' + 'with/without `stopAtErrors` set', function(done) { - if (isNodeJS()) { - pending( - 'Fails with "Unhandled promise rejection: ..." errors in Node.js.'); - } - const loadingTask1 = getDocument(buildGetDocumentParams('issue8702.pdf', { stopAtErrors: false, // The default value. }));