Added option to ignore ContentNotFoundError#128
Conversation
To match behaviour in utils.py
|
Also as it seems to be related to the long standing issue about raising |
|
I honestly don't know how to split the commits to pre/post file rename. I think we should actually just move check_output() to utils.py. :) If someone could point me to the relevant wkhtmltopdf documentation or source on its different exit codes then I would be more than happy to add the proper handling. We should probably create exceptions for the different error scenarios withe corresponding options to ignore them in one's Django app. |
|
You just need to go back in your git history with I looked quickly and there doesn't seem to be a proper documentation... wkhtmltopdf... I guess we can start with what you did here and maybe at least improve error logging to give better feedback when something goes wrong. Thanks for your time anyway. |
|
@Filipp do you think you could maybe split that commit up and I'll be very happy to merge this :-) |
|
I got a Changing to |
My use case involved rendering lots of templates with user-uploaded images so bombing on a 404 was a deal breaker. Investigated other options, but wkhtmltopdf seemed like the best fit so...
A quick glance at the wkhtmltopdf source didn't reveal any way to do this with return codes, so I resorted to checking stderr. Had to rename subprocess.py since I'm no longer using the native implementation of
check_source().Added a few doctests to process.py
To use the new behaviour, set:
In your
settings.py.