From beaef1229636ba6998eff703dfda7857772bc475 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 30 Dec 2020 21:15:01 -0500 Subject: [PATCH] Add missing first file/line in exception template --- src/Module/Special/HTTPException.php | 8 +++++++- view/templates/exception.tpl | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Module/Special/HTTPException.php b/src/Module/Special/HTTPException.php index ed962a4238..1bfae2a36e 100644 --- a/src/Module/Special/HTTPException.php +++ b/src/Module/Special/HTTPException.php @@ -69,9 +69,15 @@ class HTTPException $message = $explanation[$e->getCode()] ?? ''; } - $vars = ['$title' => $title, '$message' => $message, '$back' => DI::l10n()->t('Go back')]; + $vars = [ + '$title' => $title, + '$message' => $message, + '$back' => DI::l10n()->t('Go back'), + '$stack_trace' => DI::l10n()->t('Stack trace:'), + ]; if (is_site_admin()) { + $vars['$thrown'] = DI::l10n()->t('Exception thrown in %s:%d', $e->getFile(), $e->getLine()); $vars['$trace'] = $e->getTraceAsString(); } diff --git a/view/templates/exception.tpl b/view/templates/exception.tpl index 04e9f82c02..4b29661416 100644 --- a/view/templates/exception.tpl +++ b/view/templates/exception.tpl @@ -2,8 +2,10 @@

{{$title}}

{{$message}}

-{{if $trace}} -
{{$trace nofilter}}
+{{if $thrown}} +
{{$thrown}}
+{{$stack_trace}}
+{{$trace}}
{{/if}}