Commit 5bf882ee authored by Tino Goratsch's avatar Tino Goratsch

use some better fitting exception types

parent 066f1be9
......@@ -9,7 +9,7 @@ namespace ACP3\Core\ACL\Exception;
use ACP3\Core\Controller\Exception\ForwardControllerActionAwareExceptionInterface;
class AccessForbiddenException extends \Exception implements ForwardControllerActionAwareExceptionInterface
class AccessForbiddenException extends \RuntimeException implements ForwardControllerActionAwareExceptionInterface
{
/**
* {@inheritdoc}
......
......@@ -38,7 +38,10 @@ class CheckPermissionListener
$path = $event->getArea() . '/' . $event->getModule() . '/' . $event->getController() . '/' . $event->getControllerAction();
if ($this->acl->hasPermission($path) === false) {
throw new AccessForbiddenException();
throw new AccessForbiddenException(\sprintf(
'Access forbidden for controller action "%s"',
$path
));
}
}
}
......@@ -9,7 +9,7 @@ namespace ACP3\Core\Authentication\Exception;
use ACP3\Core\Controller\Exception\ForwardControllerActionAwareExceptionInterface;
class UnauthorizedAccessException extends \Exception implements ForwardControllerActionAwareExceptionInterface
class UnauthorizedAccessException extends \RuntimeException implements ForwardControllerActionAwareExceptionInterface
{
/**
* @var array
......
......@@ -7,7 +7,7 @@
namespace ACP3\Core\Controller\Exception;
class ControllerActionNotFoundException extends \Exception implements ForwardControllerActionAwareExceptionInterface
class ControllerActionNotFoundException extends \RuntimeException implements ForwardControllerActionAwareExceptionInterface
{
/**
* {@inheritdoc}
......
......@@ -7,7 +7,7 @@
namespace ACP3\Core\Controller\Exception;
class ResultNotExistsException extends \Exception implements ForwardControllerActionAwareExceptionInterface
class ResultNotExistsException extends \RuntimeException implements ForwardControllerActionAwareExceptionInterface
{
/**
* {@inheritdoc}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment