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

Improve Error Handling when receiving invalid PDF #138

Open
LarsWigger opened this issue Jun 5, 2024 · 5 comments
Open

Improve Error Handling when receiving invalid PDF #138

LarsWigger opened this issue Jun 5, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@LarsWigger
Copy link

I just spent quit a bit of time debugging the PdfRendererView.initWithUrl() call because the app kept crashing when trying to load a specific PDF.
In the end, the issue was that the server sent a 302 with a small HTML message when using the default headers (while accepting the default headers of every single other client I tried).

While this was not an issue on the side of Pdf-Viewer, I found the error handling pretty unhelpful and it definitely should not allow the app to crash when such a thing happens.
I encountered two separate issues: The download silently failing because it was incomplete (I think the statusListener did not react to this, even though I saw the error messages in the logs) and the main issue of the app crashing when the data received was actually not a PDF document.

I suggest trying to download invalid data and checking whether the error handling is graceful and the error logging can be improved.

Copy link

github-actions bot commented Jun 5, 2024

Thank you for creating your first issue. We appreciate your help in making this project better. We will look into it, and get back to you soon. Need help or want to discuss this issue? Join our Discord community here to ask questions and discuss this issue live!

@LarsWigger LarsWigger changed the title Improve Error Handling when receiving invalid response for Improve Error Handling when receiving invalid PDF Jun 5, 2024
Copy link

github-actions bot commented Jul 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jul 6, 2024
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
@afreakyelf afreakyelf removed the Stale label Aug 7, 2024
@afreakyelf afreakyelf reopened this Aug 7, 2024
@afreakyelf
Copy link
Owner

Thank you for the feedback. I will increase error handling.

@afreakyelf afreakyelf added the enhancement New feature or request label Aug 10, 2024
@foodpoison
Copy link

I have this issue too, a client tried to load a file that's not a PDF but have .pdf as extension, which causes the app to crash; the line the crash happened is outside of the try..catch block so there's no way for us to handle this

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

No branches or pull requests

3 participants