Rescue CombinePDF::ParsingError on 8879 signature pages #4521
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to pivotal/JIRA issue
What was done?
Investigation summary: I think the reason we get this error is that sometimes Hub users upload wonky PDFs as unsigned 8879 document types and our code that signs this document barfs and results in the client seeing an error page. I recreated this by finding the clients who got this error (for once the Sentry page had an ID of a record) and trying to sign one of their unsigned 8879 documents locally.
In order to avoid showing the error page I've done a very minimal fix to catch the error where we catch other errors (e.g. when the client has already signed). This isn't necessarily that helpful to the client but at least the banner says to contact support. There could be a more robust solution in future but we already have a feature that asks the Hub user to confirm that what they're uploading is an unsigned 8879 PDF, and this has only happened to 5 people.
How to test?
I added one test per signing service—basically copies of the existing tests around catching errors.
Acceptance testing proposal:
Screenshots (for visual change)
before (obviously this looks different on non-dev environments):
after (the second banner):