Skip to content
Snippets Groups Projects
Commit f3caade7 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

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

Closes #1716

Merge request studip/studip!1121
parent cda17d35
Branches
No related tags found
No related merge requests found
...@@ -122,10 +122,14 @@ try { ...@@ -122,10 +122,14 @@ try {
$GLOBALS['DB_STUDIP_USER'], $GLOBALS['DB_STUDIP_USER'],
$GLOBALS['DB_STUDIP_PASSWORD']); $GLOBALS['DB_STUDIP_PASSWORD']);
} catch (PDOException $exception) { } catch (PDOException $exception) {
if (Studip\ENV === 'development') {
throw $exception;
} else {
header('HTTP/1.1 500 Internal Server Error'); header('HTTP/1.1 500 Internal Server Error');
die(sprintf('database connection %s failed', 'mysql:host=' . $GLOBALS['DB_STUDIP_HOST'] . die(sprintf('database connection %s failed', 'mysql:host=' . $GLOBALS['DB_STUDIP_HOST'] .
';dbname=' . $GLOBALS['DB_STUDIP_DATABASE'])); ';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'])) {
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment