1
1
Fork 0

Add trace for admin in exceptionpages

- Fix exception message not showing on raw exception page
This commit is contained in:
Hypolite Petovan 2020-01-19 09:40:56 -05:00
parent bac5159f6f
commit 3ebc0371b7
3 changed files with 14 additions and 2 deletions

View file

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

View file

@ -2,5 +2,8 @@
<img class="hare" src="images/friendica-404_svg_flexy-o-hare.png"/>
<h1>{{$title}}</h1>
<p>{{$message}}</p>
{{if $trace}}
<pre>{{$trace nofilter}}</pre>
{{/if}}
<p><button type="button" onclick="window.history.back()" class="btn btn-primary">{{$back}}</button></p>
</div>

View file

@ -4,6 +4,9 @@
</head>
<body>
<h1>{{$title}}</h1>
<p>{{$description nofilter}}</p>
<p>{{$message nofilter}}</p>
{{if $trace}}
<pre>{{$trace nofilter}}</pre>
{{/if}}
</body>
</html>