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).
This commit is contained in:
Jonas Jenwald 2019-08-19 13:02:52 +02:00
parent 66e0dd1b06
commit 711040ecc5
2 changed files with 6 additions and 7 deletions
src/core
test/unit

@ -501,7 +501,9 @@ var WorkerMessageHandler = {
{ featureId: UNSUPPORTED_FEATURES.unknown, }); { featureId: UNSUPPORTED_FEATURES.unknown, });
sink.error(reason); sink.error(reason);
throw reason;
// TODO: Should `reason` be re-thrown here (currently that casues
// "Uncaught exception: ..." messages in the console)?
}); });
}); });
}, this); }, this);
@ -538,7 +540,9 @@ var WorkerMessageHandler = {
return; // ignoring errors from the terminated thread return; // ignoring errors from the terminated thread
} }
sink.error(reason); sink.error(reason);
throw reason;
// TODO: Should `reason` be re-thrown here (currently that casues
// "Uncaught exception: ..." messages in the console)?
}); });
}); });
}); });

@ -1281,11 +1281,6 @@ describe('api', function() {
it('gets operatorList, from corrupt PDF file (issue 8702), ' + it('gets operatorList, from corrupt PDF file (issue 8702), ' +
'with/without `stopAtErrors` set', function(done) { 'with/without `stopAtErrors` set', function(done) {
if (isNodeJS()) {
pending(
'Fails with "Unhandled promise rejection: ..." errors in Node.js.');
}
const loadingTask1 = getDocument(buildGetDocumentParams('issue8702.pdf', { const loadingTask1 = getDocument(buildGetDocumentParams('issue8702.pdf', {
stopAtErrors: false, // The default value. stopAtErrors: false, // The default value.
})); }));