mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 03:46:39 +00:00
Fixed guessing a template info for exceptions
This commit is contained in:
@@ -229,6 +229,8 @@ class Twig_Error extends Exception
|
||||
|
||||
while ($e = array_pop($exceptions)) {
|
||||
$traces = $e->getTrace();
|
||||
array_unshift($traces, array('file' => $e->getFile(), 'line' => $e->getLine()));
|
||||
|
||||
while ($trace = array_shift($traces)) {
|
||||
if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
|
||||
continue;
|
||||
|
||||
@@ -6,4 +6,4 @@ Exception for an undefined trait
|
||||
{% block bar %}
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig".
|
||||
Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2.
|
||||
|
||||
Reference in New Issue
Block a user