Skip to content
PHP Ecosystem
Explore

RangeNotSatisfiableHttpException

API reference › yii › web › RangeNotSatisfiableHttpException

classyii\web\RangeNotSatisfiableHttpException
ExtendsHttpException » yii\base\UserException » yii\base\Exception » Exception
Since2.0.11
Sourceframework/web/RangeNotSatisfiableHttpException.php

RangeNotSatisfiableHttpException represents an exception caused by an improper request of the end-user.

This exception thrown when the requested range is not satisfiable: the client asked for a portion of the file (byte serving), but the server cannot supply that portion. For example, if the client asked for a part of the file that lies beyond the end of the file.

Throwing an RangeNotSatisfiableHttpException like in the following example will result in the error page with error 416 to be displayed.

PropertyTypeDescriptionDefined by
$statusCodeintHTTP status code, such as 403, 404, 500, etc. Default: null.HttpException
MethodDescriptionDefined by
__construct()Constructor.RangeNotSatisfiableHttpException
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.