diff --git a/framework/web/ForbiddenHttpException.php b/framework/web/ForbiddenHttpException.php index c3ebf7e9d1..c05511e8b9 100644 --- a/framework/web/ForbiddenHttpException.php +++ b/framework/web/ForbiddenHttpException.php @@ -10,7 +10,7 @@ namespace yii\web; /** * ForbiddenHttpException represents a "Forbidden" HTTP exception with status code 403. * - * @author Qiang Xue + * @author Dan Schmidt * @since 2.0 */ class ForbiddenHttpException extends HttpException diff --git a/framework/web/UnauthorizedHttpException.php b/framework/web/UnauthorizedHttpException.php new file mode 100644 index 0000000000..50d86dca9b --- /dev/null +++ b/framework/web/UnauthorizedHttpException.php @@ -0,0 +1,28 @@ + + * @since 2.0 + */ +class UnauthorizedHttpException extends HttpException +{ + /** + * Constructor. + * @param string $message error message + * @param integer $code error code + * @param \Exception $previous The previous exception used for the exception chaining. + */ + public function __construct($message = null, $code = 0, \Exception $previous = null) + { + parent::__construct(401, $message, $code, $previous); + } +}