Exit code / http error documentation #1502
Comments
Can you submit a pull request for the changes? I'm going to try to track down the HTML header issue over the weekend. |
I get a similar scenario. This is the output I get for a basic html page that contains a google map injected using js from https://maps.googleapis.com/maps/api/js.
The pdf comes out acceptable, it's just the exit code would say otherwise. 👍 for a fix to this |
Just would like to confirm: was |
For me yes, the above is the entire message I got. |
so you didn't see any other error codes above 1000? looks like I have a fix ready, then... |
Just wanted to mention that I got an error code 1203:
I also got a PDF that was fine. The files that failed to load were relative URLs that were pulled in via AJAX, but those were not my concern. -EDIT- removing the local URLs still resulted in the same error code. Not sure what's the cause now. Unfortunately, I cannot test this fix as I rely on the PHP Composer distribution at https://github.com/h4cc/wkhtmltopdf-i386, and don't know how to compile the latest version of this. |
according to the list of errors, 203 is ContentNotFoundError ie an AJAX 404. It would be reported more correctly in the latest commit, but the error would still remain. |
Binaries for Linux/Windows (32/64-bit) of the latest development snapshot are available, please test whether they work for you. Mac OS X binaries should be available in a day or so. |
Mac OS X binaries are available now as well. |
Looks good, getting a |
This is what I now get
But this still leaves the issue of not being able to determine between errors and warnings. The test PDF I ran didn't render the map just like previous version of wkhtmltopdf. Before I had warnings messages and an exit code of 1. I would like to be able to determine if there were warnings or errors in the exit code. |
@pflannery: look at the |
My original issue was with the documentation. On wkhtmltopdf.org, the manual or somewhere I wanted to see a table explaining the exit codes. Something like this:
That would be very very useful documentation, so that the users could check this when they don't get exit(0). I would use this too, because if I get a 404 or something like that for some images or whatnot, I still want the PDF to be generated and I will be happy to serve it. I don't have a pull request because I have no idea how to do this, where to do this or even how to do pull requests - sorry! Maybe they coyld be in README.md and wkhtmltopdf.org and the manual all three? |
@Req: a lot of times multiple situations could be possible, also I am not sure that it would be possible to report all of them. On the documentation front, I agree -- there is quite a lot that can be improved and will happen as time permits. The website is in the repository wkhtmltopdf.github.io -- if someone submits a PR, it will auto-update the website once accepted. |
This error occurs when url are defined as //url... in place of https://url.... Solved for me. |
I'm having a similar issue where I'm seeing exit code |
… a PDF will have been generated - see wkhtmltopdf/wkhtmltopdf#1502 (comment).
When testing I kept getting exit code 1 quite often due to http error 1005 or 1xxx. Is there any documentation on exit codes and http error codes? It seems like exit code 1 usually can be ignored and happens only when something doesn't return 200 or such on the page. But what about the http errors? Http error 1005 doesn't really tell me anything
From looking at https://github.com/wkhtmltopdf/wkhtmltopdf/blob/master/src/lib/utilities.cc it would look to me like anything returning 404 would mean a returncode 2 and 401 would be 3 and anythign else is 1. Error 1005 doesn't sound like any http error I know. If I didn't fail it comes from PdfConverter's httpErrorCode() and there it comes from pageLoader.httpErrorCode(), but that's as far as I got tracing them from the source.
Documentation would be helpful in knowing which errors to ignore, currently it would seem to me like exit codes 0, 1, 2 and 3 can just be ignored quite safely.
The text was updated successfully, but these errors were encountered: