diff options
author | diosmosis <benaka@piwik.pro> | 2014-09-07 05:54:42 +0400 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-09-07 05:54:42 +0400 |
commit | 4e01c7904ef44fc7ff027676c9c4085c8cb86a06 (patch) | |
tree | c06342fa571f4ac21c9819ee9cea2e5587d808a8 /core | |
parent | f7a88dbbe2923b98a3a8fdf60ff1a79b3da81882 (diff) |
Refs #6103, add logging for exceptions caught in View.php.
Diffstat (limited to 'core')
-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; |