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
No related branches found
No related tags found
No related merge requests found
......@@ -122,9 +122,13 @@ try {
$GLOBALS['DB_STUDIP_USER'],
$GLOBALS['DB_STUDIP_PASSWORD']);
} catch (PDOException $exception) {
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']));
if (Studip\ENV === 'development') {
throw $exception;
} 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
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