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

Wrong parameters for PDOException? #106

Open
jakejohns opened this issue Jun 9, 2019 · 1 comment
Open

Wrong parameters for PDOException? #106

jakejohns opened this issue Jun 9, 2019 · 1 comment

Comments

@jakejohns
Copy link
Contributor

Was trying to get the following:

PDOException (23000) SQLSTATE[23000]: Integrity constraint violation...

But I eneded up with:

Wrong parameters for PDOException([string $message [, long $code [, Throwable $previous = NULL]]])

because:

throw new $c($e->getMessage(), $e->getCode(), $e);

I think casting the code to an int resolves the issue, but I havent inspected enough to know if thats the correct solution:

throw new $c($e->getMessage(), (int) $e->getCode(), $e); 
@ElGigi
Copy link

ElGigi commented Jun 12, 2019

I did a pull request on this problem: #98
I wait merging. Any news ?

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

No branches or pull requests

2 participants