1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-07-31 10:04:20 +03:00

explode if there is no db connection made

This commit is contained in:
David Goodwin
2019-02-10 12:11:58 +00:00
parent 0afdb5619b
commit 28870e4b45

View File

@ -1433,11 +1433,16 @@ EOF;
*
* Return value:
*
* @return \PDO|false
* @return \PDO
*/
function db_connect() {
list($link, $_) = db_connect_with_errors();
unset($_);
if(!$link instanceof PDO) {
throw new Exception("Database connection failed");
}
return $link;
}