Skip to content

Commit f69b965

Browse files
authored
Fix: Original Throwable when rendering component get lost
1 parent 1b4c6b3 commit f69b965

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TwigComponent/src/Twig/ComponentExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function throwRuntimeError(string $name, \Throwable $e): void
121121
}
122122

123123
if (!($e instanceof \Exception)) {
124-
$e = new \Exception($e->getMessage(), $e->getCode(), $e->getPrevious());
124+
$e = new \Exception($e->getMessage(), $e->getCode(), $e);
125125
}
126126

127127
throw new RuntimeError(\sprintf('Error rendering "%s" component: %s', $name, $e->getMessage()), previous: $e);

0 commit comments

Comments
 (0)