Skip to content


Subversion checkout URL

You can clone with
Download ZIP


RedBean_Driver_PDO connect() throws PDOException without the code #262

MarkoTukiainen opened this Issue · 2 comments

2 participants


It seems that RedBean_Driver_PDO has been changed in a way that the connect() method throws a PDOException with the message "Could not connect to database." and error code 0.

I had a function that relied on the resulting PDOException's code to handle the error appropriately: 1044 for access denied, 1049 for unknown database, etc.

So, could you please change the method so that on error the connect() method would throw a PDOException with the original code?


Ah, this has been done because some users forgot to turn off error reporting on production servers thus revealing sensitive security details. I now catch the original exception and re-throw a very neutral one. I will change the code to send the original error code along.


Has been released on website: version 3.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.