You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw new UnhandledException($msg, $err->getCode(), $err);
I'm not exactly the mechanism this got called, but it got called when I had a PDO Exception. The problem is that getCode on a PDOException doesn't always return an int. This is mentioned at https://secure.php.net/manual/en/exception.getcode.php. "Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException)."
So instead of my global exception handler telling me what went wrong, I got an error about a Wrong parameters passed to the Exception constructor. Maybe just rethrow the same exception instead of wrapping it in an UnhandledException, which might other important info in the original?
The text was updated successfully, but these errors were encountered:
I don't think I ever did. After figuring out which exception was causing the problem, I fixed the error in my sql query and haven't had to deal with it since. Sorry.
https://github.com/chriso/klein.php/blob/master/src/Klein/Klein.php#L931
I'm not exactly the mechanism this got called, but it got called when I had a PDO Exception. The problem is that
getCode
on a PDOException doesn't always return an int. This is mentioned at https://secure.php.net/manual/en/exception.getcode.php. "Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException)."So instead of my global exception handler telling me what went wrong, I got an error about a Wrong parameters passed to the Exception constructor. Maybe just rethrow the same exception instead of wrapping it in an UnhandledException, which might other important info in the original?
The text was updated successfully, but these errors were encountered: