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); } }