Add exception class to whoops screen

This commit is contained in:
slawkens 2021-06-09 01:46:08 +02:00
parent 1427dc3ede
commit a5ccc794bc
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -64,6 +64,8 @@
<div class="center wide">
<h2 class="wide">Whoops something went wrong...</h2>
<div class="error wide">
Exception class: {{ exceptionClass }}()
<br/><br/>
{{ message }}
<br/><br/><br/>
<b>Backtrace:</b><br/><br/>
@ -74,4 +76,4 @@
<p>{{ powered_by }}</p>
</div>
</body>
</html>
</html>