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

Pass on error code in checkProcessStatus #328

Conversation

leimd
Copy link

@leimd leimd commented Nov 7, 2018

There is a known issue in wkhtmltopdf where it will generate the pdf and still return error code 1. People have opened issues in the past for this problem: #257 #90 .
By adding the error code to the exception thrown by checkProcessStatus, it gives the end user the ability to check for the error code and catch this exception and swallow it if possible.

@akerouanton
Copy link
Contributor

akerouanton commented Dec 7, 2018

@leimd Do you have a link to an issue on wkhtmltopdf repo with more details about this issue? Ideally, this sort of error should not leak out of snappy. Instead of providing the user a way to ignore this error, we should ignore it when we know it can be.

@leimd
Copy link
Author

leimd commented Dec 7, 2018

Hi @NiR- ,

It looks like there are several issues open on wkhtmltopdf that relates to what we are experiencing.

Exit with code 1 due to network error: ContentNotFoundError

unreachable IMG src path, with invalid ext on URL gets ContentNotFoundError

My goal of this PR is really to pass on the error code to the end user. This way the end user can decide what to do with the error code. For our use case, we're not so strict so that error code 1 is acceptable, but other users whose more strict can re throw the Exception if they want. (default behavior)

@akerouanton
Copy link
Contributor

@leimd Ok fine :) I'm gonna merge it, but first could you add an entry in the FAQ please?

@leimd
Copy link
Author

leimd commented Dec 11, 2018

@NiR- Thanks. Looks like there's some conflict, I will resolve the conflict and add an entry to the FAQ. Once I finish these I will ping you again.

@leimd leimd force-pushed the pass-on-status-code-in-checkProcessStatus branch 3 times, most recently from 95b4e10 to 8da4a4c Compare December 12, 2018 00:11
@leimd
Copy link
Author

leimd commented Dec 12, 2018

Hi @NiR- ,

I've resolved the conflict and updated the FAQ. However styleci seems to be failing for unknown reason and appveyor is failing as well. Would you mind to take a look at those? sorry I don't have much experience with the aforementioned two services.

-Tom


$this->expectException(\RuntimeException::class);
$r->invokeArgs($media, [1, '', 'Could not connect to X', 'the command']);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StyleCI complains about whitespaces on this line. Could you leave it empty please?

@akerouanton
Copy link
Contributor

Don't worry about the error on AppVeyor: it's a sporadic error happening for whatever reason. I'll try to rebuild your PR a few time to get it green.

@leimd leimd force-pushed the pass-on-status-code-in-checkProcessStatus branch from 5605249 to 07d85f5 Compare December 13, 2018 19:40
@leimd
Copy link
Author

leimd commented Dec 13, 2018

@NiR- Good news! Comment addressed, styleci passing now. looks like it's ready to merge

@akerouanton
Copy link
Contributor

Thanks @leimd :) AppVeyor jobs are still randomly failing but whatever...

@akerouanton akerouanton merged commit b298f8e into KnpLabs:master Dec 14, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants