From c07a0cdcd5417da9f5208f8fb49b63d795e17a64 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Thu, 10 Sep 2020 20:44:03 +0000 Subject: [PATCH] [EXCEPTION] Add base class to invalid form exception and add URL arguments to redirect exception --- src/Util/Exception/InvalidFormException.php | 2 +- src/Util/Exception/RedirectException.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Util/Exception/InvalidFormException.php b/src/Util/Exception/InvalidFormException.php index 654a5c1ef2..0c23d29564 100644 --- a/src/Util/Exception/InvalidFormException.php +++ b/src/Util/Exception/InvalidFormException.php @@ -21,7 +21,7 @@ namespace App\Util\Exception; -class InvalidFormException +class InvalidFormException extends ClientException { public function __construct() { diff --git a/src/Util/Exception/RedirectException.php b/src/Util/Exception/RedirectException.php index a461dabf2b..ea1033410e 100644 --- a/src/Util/Exception/RedirectException.php +++ b/src/Util/Exception/RedirectException.php @@ -27,10 +27,10 @@ class RedirectException extends Exception { public ?RedirectResponse $redirect_response = null; - public function __construct(string $url_id = '', $message = '', $code = 302, Exception $previous_exception = null) + public function __construct(string $url_id = '', array $args = [], $message = '', $code = 302, Exception $previous_exception = null) { if (!empty($url_id)) { - $this->redirect_response = new RedirectResponse(Router::url($urlid)); + $this->redirect_response = new RedirectResponse(Router::url($url_id, $args)); } parent::__construct($message, $code, $previous_exception); }