8000 Fixing regression in TwigEngine exception handling. · symfony/symfony@390cb33 · GitHub
[go: up one dir, main page]

Skip to content

Commit 390cb33

Browse files
author
Bertalan Attila
committed
Fixing regression in TwigEngine exception handling.
1 parent 1038221 commit 390cb33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Bundle/TwigBundle/TwigEngine.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ public function render($name, array $parameters = array())
7474
if ($name instanceof TemplateReference) {
7575
try {
7676
// try to get the real name of the template where the error occurred
77-
$name = $e->getTemplateName();
78-
$path = (string) $this->locator->locate($this->parser->parse($name));
7977
if (method_exists($e, 'setSourceContext')) {
80-
$e->setSourceContext(new \Twig_Source('', $name, $path));
78+
$e->setSourceContext($e->getSourceContext());
8179
} else {
80+
$templateName = $e->getTemplateName();
81+
$path = (string) $this->locator->locate($this->parser->parse($templateName));
8282
$e->setTemplateName($path);
8383
}
8484
} catch (\Exception $e2) {

0 commit comments

Comments
 (0)
0