]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/visitor/ErrorController.php
Merge branch 'master' into v0.12
[github/shaarli/Shaarli.git] / application / front / controller / visitor / ErrorController.php
index 10aa84c806ea444b85a692e1d6d9d188eed4cba4..428e82542df2b56695c05db30e3e68269fe09437 100644 (file)
@@ -26,12 +26,15 @@ 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(
-                    'stacktrace',
-                    nl2br(get_class($throwable) .': '. PHP_EOL . $throwable->getTraceAsString())
+                    '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.'));
             }
@@ -39,7 +42,6 @@ class ErrorController extends ShaarliVisitorController
             $response = $response->withStatus(500);
         }
 
-
         return $response->write($this->render('error'));
     }
 }