diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index dc7f5f5..c490eb3 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -9,6 +9,7 @@ Yii Framework 2 Change Log - Bug #19148: Fix undefined array key errors in `yii\db\ActiveRelationTrait` (stevekr) - Bug #19041: Fix PHP 8.1 issues (longthanhtran, samdark, pamparam83, sartor, githubjeka) - Enh #19171: Added `$pagination` and `$sort` to `\yii\rest\IndexAction` for easy configuration (rhertogh) +- Bug #19191: Change `\Exception` to `\Throwable` in `BadRequestHttpException` and `HttpException` (Dmitrijlin) 2.0.44 December 30, 2021 diff --git a/framework/web/BadRequestHttpException.php b/framework/web/BadRequestHttpException.php index 08f7382..48d439d 100644 --- a/framework/web/BadRequestHttpException.php +++ b/framework/web/BadRequestHttpException.php @@ -25,9 +25,9 @@ class BadRequestHttpException extends HttpException * Constructor. * @param string $message error message * @param int $code error code - * @param \Exception $previous The previous exception used for the exception chaining. + * @param \Throwable|null $previous The previous exception used for the exception chaining. */ - public function __construct($message = null, $code = 0, \Exception $previous = null) + public function __construct($message = null, $code = 0, $previous = null) { parent::__construct(400, $message, $code, $previous); } diff --git a/framework/web/HttpException.php b/framework/web/HttpException.php index 15ad444..e1a5698 100644 --- a/framework/web/HttpException.php +++ b/framework/web/HttpException.php @@ -40,9 +40,9 @@ class HttpException extends UserException * @param int $status HTTP status code, such as 404, 500, etc. * @param string $message error message * @param int $code error code - * @param \Exception $previous The previous exception used for the exception chaining. + * @param \Throwable|null $previous The previous exception used for the exception chaining. */ - public function __construct($status, $message = null, $code = 0, \Exception $previous = null) + public function __construct($status, $message = null, $code = 0, $previous = null) { $this->statusCode = $status; parent::__construct((string)$message, $code, $previous);