Browse Source

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

tags/2.0.45
Dmitrijlin 3 years ago committed by GitHub
parent
commit
0eaa71d46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      framework/CHANGELOG.md
  2. 4
      framework/web/BadRequestHttpException.php
  3. 4
      framework/web/HttpException.php

1
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

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

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

Loading…
Cancel
Save