From 3ebc0371b71b9fb2522bdb9538fc34ec48653d08 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 19 Jan 2020 09:40:56 -0500 Subject: [PATCH] Add trace for admin in exceptionpages - Fix exception message not showing on raw exception page --- src/Module/Special/HTTPException.php | 8 +++++++- view/templates/exception.tpl | 3 +++ view/templates/http_status.tpl | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Module/Special/HTTPException.php b/src/Module/Special/HTTPException.php index d2c8503859..55357d09c6 100644 --- a/src/Module/Special/HTTPException.php +++ b/src/Module/Special/HTTPException.php @@ -50,7 +50,13 @@ class HTTPException $message = $explanation[$e->getCode()] ?? ''; } - return ['$title' => $title, '$message' => $message, '$back' => DI::l10n()->t('Go back')]; + $vars = ['$title' => $title, '$message' => $message, '$back' => DI::l10n()->t('Go back')]; + + if (is_site_admin()) { + $vars['$trace'] = $e->getTraceAsString(); + } + + return $vars; } /** diff --git a/view/templates/exception.tpl b/view/templates/exception.tpl index 6c26168908..04e9f82c02 100644 --- a/view/templates/exception.tpl +++ b/view/templates/exception.tpl @@ -2,5 +2,8 @@

{{$title}}

{{$message}}

+{{if $trace}} +
{{$trace nofilter}}
+{{/if}}

diff --git a/view/templates/http_status.tpl b/view/templates/http_status.tpl index 6b366d6f04..a9c094c4b2 100644 --- a/view/templates/http_status.tpl +++ b/view/templates/http_status.tpl @@ -4,6 +4,9 @@

{{$title}}

-

{{$description nofilter}}

+

{{$message nofilter}}

+ {{if $trace}} +
{{$trace nofilter}}
+ {{/if}} -- 2.39.5