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

Fixed critical unhandled promise that prevented error catching using API #9689

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

RafaPolit
Copy link
Contributor

@RafaPolit RafaPolit commented Apr 24, 2018

The affected line causes an unhandled rejection if any code inside _nextBound throws an error.

This makes using the API impossible, as there is no way of catching a failing PDF.

For this issue, the offending PDF and the underlying problem throwing the error, please refer to: #9675

This PR fixes the unhandled rejection error only. This is not a fix for the error that is being thrown. It's just an indispensable catch to the promise so that the error can bubble up to where it should in order for the error to be catched.

@RafaPolit
Copy link
Contributor Author

If this PR has no conflicts, even after all the changes of late, please consider merging it. It's just one line and really allows for error handling in a lot of situations where we are just stuck with no way of catching errors.

We would really hope to use the main package instead of running temporary forks, so if you would venture a timeframe of implementation, that would be great.

Thanks for all the hard work! Best regards,
Rafa.

@brendandahl
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/782d81c0232499d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/038a23057514511/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/782d81c0232499d/output.txt

Total script time: 19.21 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/038a23057514511/output.txt

Total script time: 23.42 mins

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

Image differences available at: http://54.215.176.217:8877/038a23057514511/reftest-analyzer.html#web=eq.log

@brendandahl brendandahl merged commit 3ac638f into mozilla:master Jun 11, 2018
@brendandahl
Copy link
Contributor

Thanks for the patch!

movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Fixed critical unhandled promise that prevented error catching using API
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.

None yet

4 participants