Troubleshooting error display

main
Yasen Pramatarov 2024-11-08 12:39:38 +02:00
parent 686d2c1153
commit d32e270598
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ function connectDB($config, $database = '', $dbFile = '', $platformId = '') {
'dbFile' => $config['db']['sqlite_file'], 'dbFile' => $config['db']['sqlite_file'],
]); ]);
$pdo = $db->getConnection(); $pdo = $db->getConnection();
return $db; return ['db' => $db, 'error' => null];
} catch (Exception $e) { } catch (Exception $e) {
$error = getError('Error connecting to DB.', $e->getMessage()); $error = getError('Error connecting to DB.', $e->getMessage());
return $error; return $error;
@ -48,7 +48,7 @@ function connectDB($config, $database = '', $dbFile = '', $platformId = '') {
'password' => $config['db']['sql_password'], 'password' => $config['db']['sql_password'],
]); ]);
$pdo = $db->getConnection(); $pdo = $db->getConnection();
return $db; return ['db' => $db, 'error' => null];
} catch (Exception $e) { } catch (Exception $e) {
$error = getError('Error connecting to DB.', $e->getMessage()); $error = getError('Error connecting to DB.', $e->getMessage());
return $error; return $error;