Fix #19191: Change \Exception to \Throwable in BadRequestHttpException and HttpException

This commit is contained in:
Dmitrijlin
2022-01-27 00:51:23 +03:00
committed by GitHub
parent acdd8894dc
commit 0eaa71d46c
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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);