Troubleshooting errors displaying

main
Yasen Pramatarov 2024-11-08 12:40:32 +02:00
parent d32e270598
commit a272d50174
1 changed files with 2 additions and 9 deletions

View File

@ -31,10 +31,7 @@ function connectDB($config, $database = '', $dbFile = '', $platformId = '') {
$pdo = $db->getConnection();
return ['db' => $db, 'error' => null];
} catch (Exception $e) {
$error = getError('Error connecting to DB.', $e->getMessage());
return $error;
// include '../app/templates/block-message.php';
// exit();
return ['db' => null, 'error' => getError('Error connecting to DB.', $e->getMessage())];
}
// mysql/mariadb database
} elseif ($config['db']['db_type'] === 'mysql' || $config['db']['db_type'] === 'mariadb') {
@ -50,10 +47,7 @@ function connectDB($config, $database = '', $dbFile = '', $platformId = '') {
$pdo = $db->getConnection();
return ['db' => $db, 'error' => null];
} catch (Exception $e) {
$error = getError('Error connecting to DB.', $e->getMessage());
return $error;
// include '../app/templates/block-message.php';
// exit();
return ['db' => null, 'error' => getError('Error connecting to DB.', $e->getMessage())];
}
// unknown database
} else {
@ -64,6 +58,5 @@ function connectDB($config, $database = '', $dbFile = '', $platformId = '') {
}
// return $db;
}
?>