diff --git a/www/_include.php b/www/_include.php
index a1bbe0e98d1d285394058fb8edea032acfdd021b..78451ee31db218f69dae7f1d2a514d63eb5c0084 100644
--- a/www/_include.php
+++ b/www/_include.php
@@ -53,7 +53,8 @@ function SimpleSAML_error_handler($errno, $errstr, $errfile = null, $errline = 0
     }
 
     // show an error with a full backtrace
-    $e = new \SimpleSAML\Error\Exception('Error '.$errno.' - '.$errstr);
+    $context = (is_null($errfile)?'':" at $errfile:$errline") . (is_null($errcontext)?'':" $errcontext");
+    $e = new \SimpleSAML\Error\Exception('Error '.$errno.' - '.$errstr . $context);
     $e->logError();
 
     // resume normal error processing