Skip to content

WireException class -- Fatal Error: Uncaught TypeError: Exception #2064

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

Open
BrendonKoz opened this issue Apr 17, 2025 · 1 comment
Open

Comments

@BrendonKoz
Copy link

As shown in a community forum discussion, there is a potential for a PDOException to return a code value that is alphanumeric, but PHP strict typing declares the code parameter to be of type INT. Ironically, the PHP documentation for Exception::getCode, which declares the parameter to be of type INT, even states that PDOException may return a string value. 🤦

If extending from these exceptions, to prevent errors, some typecasting will likely be necessary on the code property.

ryancramerdesign added a commit to processwire/processwire that referenced this issue Apr 18, 2025
…xception 'code' string values, like those used by PDOException, and added new WireException() function to faciliate it.
@ryancramerdesign
Copy link
Member

Thanks @BrendonKoz I've pushed an update to hopefully fix this, but as I don't know what sequence of events triggered that error, I am not able to duplicate the same scenario so just need confirmation that this fixes the issue.

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

No branches or pull requests

2 participants