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

Type error #19

Closed
rybakit opened this issue Jun 28, 2017 · 4 comments
Closed

Type error #19

rybakit opened this issue Jun 28, 2017 · 4 comments
Labels

Comments

@rybakit
Copy link
Contributor

rybakit commented Jun 28, 2017

Got this error recently:

Argument 3 passed to Amp\Parallel\Worker\TaskException::__construct() 
must be of the type integer, string given, 
called in .../vendor/amphp/parallel/lib/Worker/Internal/TaskFailure.php on line 54

This happens because PDOException::getCode() can return a string.

@kelunik
Copy link
Member

kelunik commented Jun 28, 2017

Thanks for reporting, #20 should fix this.

@kelunik kelunik added the bug label Jun 28, 2017
@kelunik
Copy link
Member

kelunik commented Jun 28, 2017

I think the actual fix for v0.2 should be to simply not reuse the exception code of the parent exception, but instead just use 0 there and remove the parameter from the constructor.

@bwoebi
Copy link
Member

bwoebi commented Jun 28, 2017

I agree here. The code is just part of the parent exception, it has no business in the wrapping exception.

@kelunik
Copy link
Member

kelunik commented Jun 28, 2017

But changing that now would be a BC break, so let's do it for v0.2 only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants