diff --git a/modules/core/www/authenticate.php b/modules/core/www/authenticate.php
index 5b97da3db762921ce927c0b4d120774676bcffb5..b6308d36ed48b57ae27b0827d97b96b8c21a8e0a 100644
--- a/modules/core/www/authenticate.php
+++ b/modules/core/www/authenticate.php
@@ -24,12 +24,7 @@ if (array_key_exists(SimpleSAML_Auth_State::EXCEPTION_PARAM, $_REQUEST)) {
     assert('array_key_exists(SimpleSAML_Auth_State::EXCEPTION_DATA, $state)');
     $e = $state[SimpleSAML_Auth_State::EXCEPTION_DATA];
 
-    header('Content-Type: text/plain');
-    echo "Exception during login:\n";
-    foreach ($e->format() as $line) {
-        echo $line."\n";
-    }
-    exit(0);
+    throw $e;
 }
 
 if (!$as->isAuthenticated()) {