[EXCEPTION] Add base class to invalid form exception and add URL arguments to redirect exception

This commit is contained in:
Hugo Sales 2020-09-10 20:44:03 +00:00 committed by Hugo Sales
parent 96415f8523
commit 9f4a53dbbd
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@
namespace App\Util\Exception; namespace App\Util\Exception;
class InvalidFormException class InvalidFormException extends ClientException
{ {
public function __construct() public function __construct()
{ {

View File

@ -27,10 +27,10 @@ class RedirectException extends Exception
{ {
public ?RedirectResponse $redirect_response = null; 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)) { 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); parent::__construct($message, $code, $previous_exception);
} }