Skip to content

Commit 76dfc9a

Browse files
committed
Fix last frame in the stack trace (where the actual error is) being dropped
1 parent a3a0b39 commit 76dfc9a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/View/Antlers/Parser.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,9 +1427,16 @@ protected function viewException($e, $data)
14271427
$exception->setSolution($e->getSolution());
14281428
}
14291429

1430+
$trace = $exception->getPrevious()->getTrace();
1431+
1432+
array_unshift($trace, [
1433+
'file' => $e->getFile(),
1434+
'line' => $e->getLine(),
1435+
]);
1436+
14301437
$traceProperty = new ReflectionProperty('Exception', 'trace');
14311438
$traceProperty->setAccessible(true);
1432-
$traceProperty->setValue($exception, $exception->getPrevious()->getTrace());
1439+
$traceProperty->setValue($exception, $trace);
14331440

14341441
$exception->setView($this->view);
14351442
$exception->setViewData($this->getViewDataForException($data));

0 commit comments

Comments
 (0)