From a5ccc794bc73c23c321aef1f514079b45d8eee20 Mon Sep 17 00:00:00 2001 From: slawkens Date: Wed, 9 Jun 2021 01:46:08 +0200 Subject: [PATCH] Add exception class to whoops screen --- system/exception.php | 2 +- system/templates/exception.html.twig | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/system/exception.php b/system/exception.php index 5c76d66b..3ad1fefe 100644 --- a/system/exception.php +++ b/system/exception.php @@ -39,7 +39,7 @@ function exception_handler($exception) { // we just replace some values manually // cause in case Twig throws exception, we can show it too $content = file_get_contents($template_file); - $content = str_replace(array('{{ BASE_URL }}', '{{ message }}', '{{ backtrace }}', '{{ powered_by }}'), array(BASE_URL, $message, $backtrace_formatted, base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4=')), $content); + $content = str_replace(array('{{ BASE_URL }}', '{{ exceptionClass }}', '{{ message }}', '{{ backtrace }}', '{{ powered_by }}'), array(BASE_URL, get_class($exception), $message, $backtrace_formatted, base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4=')), $content); echo $content; } diff --git a/system/templates/exception.html.twig b/system/templates/exception.html.twig index 5a259079..6f505245 100644 --- a/system/templates/exception.html.twig +++ b/system/templates/exception.html.twig @@ -64,6 +64,8 @@

Whoops something went wrong...

+ Exception class: {{ exceptionClass }}() +

{{ message }}


Backtrace:

@@ -74,4 +76,4 @@

{{ powered_by }}

- \ No newline at end of file +