Commit 4b7ba213 authored by webchick's avatar webchick

Issue #2548725 by dawehner: Fix database exception handling, causing test fails in PostgreSQL

parent ad22ba70
......@@ -118,7 +118,16 @@ public static function open(array &$connection_options = array()) {
// Convert numeric values to strings when fetching.
\PDO::ATTR_STRINGIFY_FETCHES => TRUE,
);
$pdo = new \PDO($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']);
try {
$pdo = new \PDO($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']);
}
catch (\Exception $e) {
if ($e->getCode() == static::DATABASE_NOT_FOUND) {
throw new DatabaseNotFoundException($e->getMessage(), $e->getCode(), $e);
}
throw new $e;
}
return $pdo;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment