Skip to content
Snippets Groups Projects
Commit 9e0ac887 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

show exception on database connection error in development mode, fixes #1716

Closes #1716

Merge request studip/studip!1121
parent 49f733b9
No related branches found
No related tags found
No related merge requests found
...@@ -147,9 +147,13 @@ try { ...@@ -147,9 +147,13 @@ try {
$GLOBALS['DB_STUDIP_USER'], $GLOBALS['DB_STUDIP_USER'],
$GLOBALS['DB_STUDIP_PASSWORD']); $GLOBALS['DB_STUDIP_PASSWORD']);
} catch (PDOException $exception) { } catch (PDOException $exception) {
header('HTTP/1.1 500 Internal Server Error'); if (Studip\ENV === 'development') {
die(sprintf('database connection %s failed', 'mysql:host=' . $GLOBALS['DB_STUDIP_HOST'] . throw $exception;
';dbname=' . $GLOBALS['DB_STUDIP_DATABASE'])); } else {
header('HTTP/1.1 500 Internal Server Error');
die(sprintf('database connection %s failed', 'mysql:host=' . $GLOBALS['DB_STUDIP_HOST'] .
';dbname=' . $GLOBALS['DB_STUDIP_DATABASE']));
}
} }
// set slave connection // set slave connection
if (isset($GLOBALS['DB_STUDIP_SLAVE_HOST'])) { if (isset($GLOBALS['DB_STUDIP_SLAVE_HOST'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment