diff --git a/lib/bootstrap.php b/lib/bootstrap.php
index f387a6e15b727218c71b295ee2f510d131798797..fcc1f4816965b118360f7f0bed3e1107df0ede19 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -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'])) {