-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rethrow MissingDataException when needed #8184
Rethrow MissingDataException when needed #8184
Conversation
In core/document.js: `PDFDocument.prototype.parse` accesses a dictionary property, which could throw if the underlying data is not yet available. In core/obj.js: `get Catalog.prototype.metadata` calls `stream.getBytes`, which can throw MissingDataException too when the stream is a ChunkedStream.
/botio unittest |
From: Bot.io (Linux)ReceivedCommand cmd_unittest from @Rob--W received. Current queue size: 0 Live output at: http://107.21.233.14:8877/675be5f607b525c/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Rob--W received. Current queue size: 0 Live output at: http://54.215.176.217:8877/5e940bf99215363/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/5e940bf99215363/output.txt Total script time: 5.68 mins
|
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/675be5f607b525c/output.txt Total script time: 60.00 mins |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c4dea0b11827440/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/74d662e5dcc36da/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c4dea0b11827440/output.txt Total script time: 28.34 mins
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what's up with the Windows bot, but considering that the unit-tests passed earlier and that all tests passed on Linux, this should be fine.
Nice follow-up, thank you for the patch!
…eeded Rethrow MissingDataException when needed
@Snuffleupagus Following #8183, I ran
grep -r 'catch (' -A 2
and identified some more cases oftry-catch
where the catch clause should rethrow.In core/document.js:
PDFDocument.prototype.parse
accesses a dictionary property, which could throw if the underlying data is not yet available.In core/obj.js:
get Catalog.prototype.metadata
callsstream.getBytes
, which can throw MissingDataException too when the stream is a ChunkedStream.