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()] ?? '';
}
$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();
}

View File

@ -2,8 +2,10 @@
<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 $thrown}}
<pre>{{$thrown}}
{{$stack_trace}}
{{$trace}}</pre>
{{/if}}
<p><button type="button" onclick="window.history.back()" class="btn btn-primary">{{$back}}</button></p>
</div>