]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/visitor/ErrorController.php
Display error details even with dev.debug set to false
[github/shaarli/Shaarli.git] / application / front / controller / visitor / ErrorController.php
index 8da11172ffa52c6c8ae5967760b5a5043c05cca7..428e82542df2b56695c05db30e3e68269fe09437 100644 (file)
@@ -26,8 +26,14 @@ class ErrorController extends ShaarliVisitorController
             $response = $response->withStatus($throwable->getCode());
         } else {
             // Internal error (any other Throwable)
-            if ($this->container->conf->get('dev.debug', false)) {
-                $this->assignView('message', $throwable->getMessage());
+            if ($this->container->conf->get('dev.debug', false) || $this->container->loginManager->isLoggedIn()) {
+                $this->assignView('message', t('Error: ') . $throwable->getMessage());
+                $this->assignView(
+                    'text',
+                    '<a href="https://github.com/shaarli/Shaarli/issues/new">'
+                    . t('Please report it on Github.')
+                    . '</a>'
+                );
                 $this->assignView('stacktrace', exception2text($throwable));
             } else {
                 $this->assignView('message', t('An unexpected error occurred.'));
@@ -36,7 +42,6 @@ class ErrorController extends ShaarliVisitorController
             $response = $response->withStatus(500);
         }
 
-
         return $response->write($this->render('error'));
     }
 }