Skip to content
PHP Ecosystem
Explore

GoneHttpException

API reference › yii › web › GoneHttpException

classyii\web\GoneHttpException
ExtendsHttpException » yii\base\UserException » yii\base\Exception » Exception
Since2.0
Sourceframework/web/GoneHttpException.php

GoneHttpException represents a “Gone” HTTP exception with status code 410.

Throw a GoneHttpException when a user requests a resource that no longer exists at the requested url. For example, after a record is deleted, future requests for that record should return a 410 GoneHttpException instead of a 404 NotFoundHttpException.

See also: https://tools.ietf.org/html/rfc7231#section-6.5.9.

PropertyTypeDescriptionDefined by
$statusCodeintHTTP status code, such as 403, 404, 500, etc. Default: null.HttpException
MethodDescriptionDefined by
__construct()Constructor.GoneHttpException
getName()HttpException
public function __construct(string|null $message = null, int $code = 0, Throwable|null $previous = null)

Constructor.

Parameters

ParameterTypeDescription
$messagestring|nullError message
$codeintError code
$previousThrowable|nullThe previous exception used for the exception chaining.