mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +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)) {
|
while ($e = array_pop($exceptions)) {
|
||||||
$traces = $e->getTrace();
|
$traces = $e->getTrace();
|
||||||
|
array_unshift($traces, array('file' => $e->getFile(), 'line' => $e->getLine()));
|
||||||
|
|
||||||
while ($trace = array_shift($traces)) {
|
while ($trace = array_shift($traces)) {
|
||||||
if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
|
if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ Exception for an undefined trait
|
|||||||
{% block bar %}
|
{% block bar %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
--EXCEPTION--
|
--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