From 88554ef55f36510bad0782707fa730d25f5091ef Mon Sep 17 00:00:00 2001 From: Alexandar Bozhinov Date: Fri, 3 Nov 2023 17:10:28 +0200 Subject: [PATCH] Pass Exception message --- src/Controller/AbstractCrudController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Controller/AbstractCrudController.php b/src/Controller/AbstractCrudController.php index ebc729d721..50ca1a18ff 100644 --- a/src/Controller/AbstractCrudController.php +++ b/src/Controller/AbstractCrudController.php @@ -233,7 +233,11 @@ public function edit(AdminContext $context) $fieldName = $context->getRequest()->query->get('fieldName'); $newValue = 'true' === mb_strtolower($context->getRequest()->query->get('newValue')); - $event = $this->ajaxEdit($context->getEntity(), $fieldName, $newValue); + try { + $event = $this->ajaxEdit($context->getEntity(), $fieldName, $newValue); + } catch (\Exception $e) { + throw new BadRequestHttpException($e->getMessage()); + } if ($event->isPropagationStopped()) { return $event->getResponse();