]> git.mxchange.org Git - friendica.git/commitdiff
Add trace for admin in exceptionpages
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 19 Jan 2020 14:40:56 +0000 (09:40 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 20 Jan 2020 12:47:53 +0000 (07:47 -0500)
- Fix exception message not showing on raw exception page

src/Module/Special/HTTPException.php
view/templates/exception.tpl
view/templates/http_status.tpl

index d2c850385939cb80ed2497ec1248c2d42934e0fd..55357d09c61aa0a94f2abc286edc0f5f7df7f534 100644 (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;
        }
 
        /**
index 6c261689087938201bf1f4bfb3fbeee1e36d02b5..04e9f82c024689510632da0c034b68c3d07a150c 100644 (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>
index 6b366d6f045411d69325b17aad61b467c5a271f3..a9c094c4b23194a2857f1f8336767e255142413d 100644 (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>