Having trouble getting PDO exceptions to work, instead is raising the error handler in PHP. The connection string is fine, the port is supposed to be incorrect so I can generate a log message and show an simple error screen to the client.
Warning: PDO::__construct() [pdo.--construct]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://127.0.0.1:3305)
PHP Version 5.3.2
MySQL Version 5.1.47-community
try {
$options = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
$this->db = new PDO($dsn, $username, $password, $options);
//$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//$this->db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
} catch (PDOException $e) {
$this->throwError('PDODatabase->connect', 'Connection Failed: ' . $e->getMessage());
return false;
}