Skip to content
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

Attempt to improve the PDFDocument error message for empty files (issue 5887) #11398

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

Snuffleupagus
Copy link
Collaborator

Given that the error in question is surfaced on the API-side, this patch makes the following changes:

  • Updates the wording such that it'll hopefully be slightly easier for users to understand.
  • Changes the plain Error to an InvalidPDFException instead, since that should work better with the existing Error handling.
  • Adds a unit-test which loads an empty PDF document (and also improves a pre-existing InvalidPDFException message and its test-case).

Fixes #5887

…ssue 5887)

Given that the error in question is surfaced on the API-side, this patch makes the following changes:
 - Updates the wording such that it'll hopefully be slightly easier for users to understand.
 - Changes the plain `Error` to an `InvalidPDFException` instead, since that should work better with the existing Error handling.
 - Adds a unit-test which loads an empty PDF document (and also improves a pre-existing `InvalidPDFException` message and its test-case).
@Snuffleupagus
Copy link
Collaborator Author

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Dec 9, 2019

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/e75d77ffd2ee001/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 9, 2019

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/6d661935b6e9236/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 9, 2019

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/e75d77ffd2ee001/output.txt

Total script time: 18.83 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Dec 9, 2019

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/6d661935b6e9236/output.txt

Total script time: 26.47 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@timvandermeij timvandermeij merged commit af4ba75 into mozilla:master Dec 9, 2019
@timvandermeij
Copy link
Contributor

That should indeed be a more clear message. Thanks, also for adding a unit test!

@Snuffleupagus Snuffleupagus deleted the issue-5887 branch December 9, 2019 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better error message for zero-sized file
3 participants