diff options
Diffstat (limited to 'core/View.php')
-rw-r--r-- | core/View.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/View.php b/core/View.php index fe6494c87e..c62c0eed78 100644 --- a/core/View.php +++ b/core/View.php @@ -232,6 +232,8 @@ class View implements ViewInterface $user = APIUsersManager::getInstance()->getUser($this->userLogin); $this->userAlias = $user['alias']; } catch (Exception $e) { + Log::verbose($e); + // can fail, for example at installation (no plugin loaded yet) } @@ -253,7 +255,16 @@ class View implements ViewInterface protected function renderTwigTemplate() { - $output = $this->twig->render($this->getTemplateFile(), $this->getTemplateVars()); + try { + $output = $this->twig->render($this->getTemplateFile(), $this->getTemplateVars()); + } catch (Exception $ex) { + // twig does not rethrow exceptions, it wraps them so we log the cause if we can find it + $cause = $ex->getPrevious(); + Log::debug($cause === null ? $ex : $cause); + + throw $ex; + } + $output = $this->applyFilter_cacheBuster($output); $helper = new Theme; |