diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-11-06 10:00:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 10:00:03 +0100 |
commit | 8c5f6c786d00310b2e863aa316927effb7bfeedb (patch) | |
tree | 5f3083c9b8d7078dbb1e9986db4fb7f6f8b6266b /application | |
parent | 48df9f45b8c4b2995c1e04146071628668531b37 (diff) | |
parent | cfdd2094407e61f371c02117c8c66916a6d1d807 (diff) | |
download | Shaarli-8c5f6c786d00310b2e863aa316927effb7bfeedb.tar.gz Shaarli-8c5f6c786d00310b2e863aa316927effb7bfeedb.tar.zst Shaarli-8c5f6c786d00310b2e863aa316927effb7bfeedb.zip |
Merge pull request #1627 from ArthurHoaro/fix/unexpected-error
Display error details even with dev.debug set to false
Diffstat (limited to 'application')
-rw-r--r-- | application/front/controller/visitor/ErrorController.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/application/front/controller/visitor/ErrorController.php b/application/front/controller/visitor/ErrorController.php index 8da11172..428e8254 100644 --- a/application/front/controller/visitor/ErrorController.php +++ b/application/front/controller/visitor/ErrorController.php | |||
@@ -26,8 +26,14 @@ class ErrorController extends ShaarliVisitorController | |||
26 | $response = $response->withStatus($throwable->getCode()); | 26 | $response = $response->withStatus($throwable->getCode()); |
27 | } else { | 27 | } else { |
28 | // Internal error (any other Throwable) | 28 | // Internal error (any other Throwable) |
29 | if ($this->container->conf->get('dev.debug', false)) { | 29 | if ($this->container->conf->get('dev.debug', false) || $this->container->loginManager->isLoggedIn()) { |
30 | $this->assignView('message', $throwable->getMessage()); | 30 | $this->assignView('message', t('Error: ') . $throwable->getMessage()); |
31 | $this->assignView( | ||
32 | 'text', | ||
33 | '<a href="https://github.com/shaarli/Shaarli/issues/new">' | ||
34 | . t('Please report it on Github.') | ||
35 | . '</a>' | ||
36 | ); | ||
31 | $this->assignView('stacktrace', exception2text($throwable)); | 37 | $this->assignView('stacktrace', exception2text($throwable)); |
32 | } else { | 38 | } else { |
33 | $this->assignView('message', t('An unexpected error occurred.')); | 39 | $this->assignView('message', t('An unexpected error occurred.')); |
@@ -36,7 +42,6 @@ class ErrorController extends ShaarliVisitorController | |||
36 | $response = $response->withStatus(500); | 42 | $response = $response->withStatus(500); |
37 | } | 43 | } |
38 | 44 | ||
39 | |||
40 | return $response->write($this->render('error')); | 45 | return $response->write($this->render('error')); |
41 | } | 46 | } |
42 | } | 47 | } |