From: Hypolite Petovan Date: Sun, 19 Jan 2020 14:40:56 +0000 (-0500) Subject: Add trace for admin in exceptionpages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3ebc0371b71b9fb2522bdb9538fc34ec48653d08;p=friendica.git Add trace for admin in exceptionpages - Fix exception message not showing on raw exception page --- 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}}