From 89552aac479722247e03abae86a7030c6f20911f Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 7 Aug 2024 15:39:56 +0200 Subject: [PATCH] Fix: Original Throwable get lost during component render --- src/TwigComponent/src/Twig/ComponentExtension.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/TwigComponent/src/Twig/ComponentExtension.php b/src/TwigComponent/src/Twig/ComponentExtension.php index 82fa37a972a..14f30c382da 100644 --- a/src/TwigComponent/src/Twig/ComponentExtension.php +++ b/src/TwigComponent/src/Twig/ComponentExtension.php @@ -120,10 +120,6 @@ private function throwRuntimeError(string $name, \Throwable $e): void throw $e; } - if (!($e instanceof \Exception)) { - $e = new \Exception($e->getMessage(), $e->getCode(), $e->getPrevious()); - } - - throw new RuntimeError(\sprintf('Error rendering "%s" component: %s', $name, $e->getMessage()), previous: $e); + throw new RuntimeError(\sprintf('Error rendering "%s" component: "%s"', $name, $e->getMessage()), previous: $e); } }