[task/refactor-db-testcase] Further improve error messages.

PHPBB3-10043
This commit is contained in:
Oleg Pudeyev 2011-02-15 21:08:33 -05:00
parent d3718bf5d4
commit bd8e5ff79e

View file

@ -83,7 +83,7 @@ class phpbb_database_test_connection_manager
catch (PDOException $e) catch (PDOException $e)
{ {
$cleaned_dsn = str_replace($this->config['dbpasswd'], '*password*', $dsn); $cleaned_dsn = str_replace($this->config['dbpasswd'], '*password*', $dsn);
throw new Exception("Unable do connect to $cleaned_dsn with error: {$e->getMessage()}"); throw new Exception("Unable do connect to $cleaned_dsn using PDO with error: {$e->getMessage()}");
} }
// good for debug // good for debug
@ -338,7 +338,7 @@ class phpbb_database_test_connection_manager
} }
else else
{ {
$message = 'Supplied dbms is unsupported, must be one of: '; $message = "Supplied dbms \"$dbms\" is not a valid phpBB dbms, must be one of: ";
$message .= implode(', ', array_keys($available_dbms)); $message .= implode(', ', array_keys($available_dbms));
throw new Exception($message); throw new Exception($message);
} }