Skip to content

Commit

Permalink
Pass Exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
abozhinov authored Nov 3, 2023
1 parent cfc0d7b commit 88554ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Controller/AbstractCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Check failure on line 239 in src/Controller/AbstractCrudController.php

View workflow job for this annotation

GitHub Actions / phpstan

Instantiated class EasyCorp\Bundle\EasyAdminBundle\Controller\BadRequestHttpException not found.

Check failure on line 239 in src/Controller/AbstractCrudController.php

View workflow job for this annotation

GitHub Actions / phpstan

Throwing object of an unknown class EasyCorp\Bundle\EasyAdminBundle\Controller\BadRequestHttpException.
}

if ($event->isPropagationStopped()) {
return $event->getResponse();
Expand Down

0 comments on commit 88554ef

Please sign in to comment.