From 9f75a3fb093f4121f8459f1b2071ee9f17a4f802 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sun, 16 Jul 2023 00:12:24 +0100 Subject: [PATCH] Refactor ControllerUtils to throw NotFoundHttpException instead of SystemException for better error handling. Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/Admin/Traits/ControllerUtils.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Admin/Traits/ControllerUtils.php b/src/Admin/Traits/ControllerUtils.php index 25f59dd9..f70fd10d 100644 --- a/src/Admin/Traits/ControllerUtils.php +++ b/src/Admin/Traits/ControllerUtils.php @@ -2,8 +2,8 @@ namespace Igniter\Admin\Traits; -use Igniter\Flame\Exception\SystemException; use Igniter\Flame\Support\RouterHelper; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; trait ControllerUtils { @@ -57,7 +57,7 @@ public function checkAction($action) } if (in_array(strtolower($action), array_map('strtolower', $this->hiddenActions))) { - throw new SystemException(sprintf( + throw new NotFoundHttpException(sprintf( 'Method [%s] is not allowed in the controller [%s]', $action, get_class($this) )); @@ -75,7 +75,7 @@ public function checkAction($action) public function callAction($method, $parameters) { if (!$this->checkAction($method)) { - throw new SystemException(sprintf( + throw new NotFoundHttpException(sprintf( 'Method [%s] is not found in the controller [%s]', $method, get_class($this) ));