Display error code in connect() PDOException

Previously, when a connect failed, the only logging would consist of the cryptic "Could not connect to database.". This commit adds the error code to the log exception that is thrown.