Skip to content

Commit

Permalink
Refactor ControllerUtils to throw NotFoundHttpException instead of Sy…
Browse files Browse the repository at this point in the history
…stemException for better error handling.

Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jul 15, 2023
1 parent df81107 commit 9f75a3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Admin/Traits/ControllerUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)
));
Expand All @@ -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)
));
Expand Down

0 comments on commit 9f75a3f

Please sign in to comment.