aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/index.php b/index.php
index 2fc5771f..39e970c5 100644
--- a/index.php
+++ b/index.php
@@ -26,7 +26,18 @@ try {
}
} catch (\Throwable $e) {
error_log($e);
+
+ $message = sprintf(
+ 'Uncaught Exception %s: %s at %s line %s',
+ get_class($e),
+ $e->getMessage(),
+ trim_path_prefix($e->getFile()),
+ $e->getLine()
+ );
+
+ http_response_code(500);
print render('error.html.php', [
- 'message' => sprintf("Uncaught Exception %s: '%s'\n", get_class($e), $e->getMessage()),
+ 'message' => $message,
+ 'stacktrace' => create_sane_stacktrace($e),
]);
}