From eb7f2c65ae81e18980b3ad0fb54669655c89ab3d Mon Sep 17 00:00:00 2001 From: Sadetdin EYILI Date: Fri, 25 Oct 2024 18:11:30 +0200 Subject: [PATCH] fix: form validations are by passed when an Exception is thrown fix: https://github.com/sonata-project/SonataBlockBundle/issues/1217 --- src/Block/BlockServiceManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Block/BlockServiceManager.php b/src/Block/BlockServiceManager.php index f2bd8d1b..9f71bf27 100644 --- a/src/Block/BlockServiceManager.php +++ b/src/Block/BlockServiceManager.php @@ -149,8 +149,10 @@ public function validate(ErrorElement $errorElement, BlockInterface $block): voi } $this->inValidate = false; - } catch (\Exception) { + } catch (\Exception $exception) { $this->inValidate = false; + + throw $exception; } }