# RangeNotSatisfiableHttpException

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

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [web](/docs/api/yii/web/index.md) › RangeNotSatisfiableHttpException

| class | `yii\web\RangeNotSatisfiableHttpException` |
| --- | --- |
| Extends | [`HttpException`](/docs/api/yii/web/httpexception/index.md) » [`yii\base\UserException`](/docs/api/yii/base/userexception/index.md) » [`yii\base\Exception`](/docs/api/yii/base/exception/index.md) » [`Exception`](https://www.php.net/manual/en/class.exception.php) |
| Since | 2.0.11 |
| Source | [`framework/web/RangeNotSatisfiableHttpException.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/web/RangeNotSatisfiableHttpException.php#L24) |

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.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-statusCode"></span>[`$statusCode`](/docs/api/yii/web/httpexception/index.md#property-statusCode) | `int` | HTTP status code, such as 403, 404, 500, etc. Default: `null`. | [`HttpException`](/docs/api/yii/web/httpexception/index.md) |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Constructor. | `RangeNotSatisfiableHttpException` |
| <span id="method-getName"></span>[`getName()`](/docs/api/yii/web/httpexception/index.md#method-getName) |  | [`HttpException`](/docs/api/yii/web/httpexception/index.md) |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(string|null $message = null, int $code = 0, Throwable|null $previous = null)
```

Constructor.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$message` | `string\|null` | Error message |
| `$code` | `int` | Error code |
| `$previous` | [`Throwable`](https://www.php.net/manual/en/class.throwable.php)`\|null` | The previous exception used for the exception chaining. |