Skip to content
Snippets Groups Projects
Commit 7ded0267 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Thomas Hackl
Browse files

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

Closes #1716

Merge request !1121
parent 0a3b9222
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