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

Unreadable PDF file error should carry information to be able to identify the source #328

Closed
ediweissmann opened this issue Apr 30, 2018 · 0 comments

Comments

@ediweissmann
Copy link
Collaborator

When processing multiple files in a batch, if the task fails because one of the files cannot be opened or properly parsed, it's hard to identify which file caused the problem.

IllegalStateException: Catalog cannot be found
        at org.sejda.sambox.cos.COSDocument.lambda$getCatalog$1(COSDocument.java:130)
        at java.util.Optional.orElseThrow(Optional.java:290)
        at org.sejda.sambox.cos.COSDocument.getCatalog(COSDocument.java:130)
        at org.sejda.sambox.pdmodel.PDDocument.getDocumentCatalog(PDDocument.java:259)
        at org.sejda.sambox.pdmodel.PDDocument.getPages(PDDocument.java:305)
        at org.sejda.impl.sambox.component.PageTreeRebuilder.rebuild(PageTreeRebuilder.java:53)
        at org.sejda.impl.sambox.RepairTask.execute(RepairTask.java:79)
        at org.sejda.impl.sambox.RepairTask.execute(RepairTask.java:48)

Suggested solution:
Bubble up an exception that also carries information about the source PDF being in context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants