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