From a272d50174a829d407d178b246be1c7ae31066c6 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Fri, 8 Nov 2024 12:40:32 +0200 Subject: [PATCH] Troubleshooting errors displaying --- app/helpers/database.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/helpers/database.php b/app/helpers/database.php index ebb7ef9..e52be11 100644 --- a/app/helpers/database.php +++ b/app/helpers/database.php @@ -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; } ?>