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

Does not handle loading failures #48

Closed
gollux opened this issue Nov 30, 2021 · 0 comments
Closed

Does not handle loading failures #48

gollux opened this issue Nov 30, 2021 · 0 comments

Comments

@gollux
Copy link

gollux commented Nov 30, 2021

When I try to load a document, which is not a PDF, load_from_file succeeds, but all subsequent methods crash. The reason is that self._document becomes None and most subsequent methods are decorated with @ensure_unlocked, leading to a call of self._document.is_locked.

I am willing to fix it, but which solution do you prefer? We can add an is_broken method, which can be used after loading the document to check if it was loaded successfully. Or we can make loading throw an exception upon failure.

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

1 participant