Skip to content
Extraits de code Groupes Projets
Valider 4e01c790 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Refs #6103, add logging for exceptions caught in View.php.

parent f7a88dbb
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -232,6 +232,8 @@ class View implements ViewInterface ...@@ -232,6 +232,8 @@ class View implements ViewInterface
$user = APIUsersManager::getInstance()->getUser($this->userLogin); $user = APIUsersManager::getInstance()->getUser($this->userLogin);
$this->userAlias = $user['alias']; $this->userAlias = $user['alias'];
} catch (Exception $e) { } catch (Exception $e) {
Log::verbose($e);
// can fail, for example at installation (no plugin loaded yet) // can fail, for example at installation (no plugin loaded yet)
} }
...@@ -253,7 +255,16 @@ class View implements ViewInterface ...@@ -253,7 +255,16 @@ class View implements ViewInterface
protected function renderTwigTemplate() 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); $output = $this->applyFilter_cacheBuster($output);
$helper = new Theme; $helper = new Theme;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter