-
Notifications
You must be signed in to change notification settings - Fork 80
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
Error handling - replace .unwrap
and panic
with ?
#47
Comments
Agreed, great library, with the potential to be very useful. It works so well so often! |
I agree. I have an app processing millions of PDFs, extracting text from them. For my use case if the text cannot be extracted I just move on to the next without hard feelings. With this library I can't take this approach. |
Please share any pdfs that panic. One of the main reasons for tending toward panic instead of returning an error is that it increases the likelihood of people reporting pdfs that cause panics. |
That is a good strategy! Unfortunately most of what I deal with are not shareable on the face of it. However I will look into whether there is some way to do it. Certainly it would be nice to contribute to a more robust extractor. |
@scandox can you share some of the panic locations/messages? |
This is useful. I think it would make sense to add a panic wrapper that adds an explanation to people to:
|
It looks like there are conditions under which I can share PDFs but not as part of the public repository. If you like you could contact me directly. My email is my username at the well known Google owned email service. I have about 650 ones that panic. About 22K that cause various unknown errors. |
Hi there! Thanks for creating an maintaining this :)
I like what this crate does, but I can't really use it as a library in my project because there are many (quite common) paths that will panic. I want to handle errors, not crash my app.
I suggest we change all
.unwrap
,.expect
andpanic
with?
andErr
. We add a customResult
type and implementimpl From<&str> for Err
for convenience.UPDATE: I've opened a PR that changes most of the project to return results.
The text was updated successfully, but these errors were encountered: