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

Images not found should raise an exception #1461

Closed
discopatrick opened this issue Oct 5, 2021 · 3 comments
Closed

Images not found should raise an exception #1461

discopatrick opened this issue Oct 5, 2021 · 3 comments

Comments

@discopatrick
Copy link

I need to be able to handle cases where images were not found during write_pdf.

I can see a message logged: Failed to load image at ...: URLError: <urlopen error [Errno 2] No such file or directory: ...

But there's no way for me to catch this when it happens and handle it accordingly.

This was discussed back in #250 but it seems the preference then was to allow image load failures to fail silently and continue rendering the PDF without them.

@liZe
Copy link
Member

liZe commented Oct 5, 2021

Hello!

If you want to raise errors when 404 errors are found, the best solution is probably to use a URL fetcher. You’ll then be able to do what you want, according to the result of your HTTP request.

@liZe
Copy link
Member

liZe commented Oct 11, 2021

@discopatrick Did this solution work for you?

@liZe
Copy link
Member

liZe commented Oct 14, 2021

Feel free to reopen if needed.

@liZe liZe closed this as completed Oct 14, 2021
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