KnpLabs/snappy — pull request #84 by toiine (2014-04-03 10:03:06+00:00)
Title: CheckProcessStatus now thrown exception with exit status as code

As there : https://github.com/KnpLabs/KnpSnappyBundle/issues/33 (Option to Ignore Errors), I propose to get the exit code and handle it the way we want.

from: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1502

It give a table that explain the exit codes:

ExitCode | Explanation
-------- | ---------------
0 | All OK
1 | PDF generated OK, but some request(s) did not return HTTP 200
2 | Could not something something
X | Could not write PDF: File in use
Y | Could not write PDF: No write permission
Z | PDF generated OK, but some JavaScript requests(s) timeouted
A | Invalid arguments provided
B | Could not find input file(s)
C | Process timeout

In case of the exit code = 1, generation is acceptable, but throw an error, As i don't want to use reg exp to parse the exception message, I propose to add the wkhtmltopdf/wkhtmltoimage exit code to the exception thrown.