Add missing first file/line in exception template

This commit is contained in:
Hypolite Petovan 2020-12-30 21:15:01 -05:00
parent e342f69e21
commit beaef12296
2 changed files with 11 additions and 3 deletions

View file

@ -69,9 +69,15 @@ class HTTPException
$message = $explanation[$e->getCode()] ?? ''; $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()) { if (is_site_admin()) {
$vars['$thrown'] = DI::l10n()->t('Exception thrown in %s:%d', $e->getFile(), $e->getLine());
$vars['$trace'] = $e->getTraceAsString(); $vars['$trace'] = $e->getTraceAsString();
} }

View file

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