# ExitException

> ExitException represents a normal termination of an application.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [base](/docs/api/yii/base/index.md) › ExitException

| class | `yii\base\ExitException` |
| --- | --- |
| Extends | [`Exception`](https://www.php.net/manual/en/class.exception.php) |
| Since | 2.0 |
| Source | [`framework/base/ExitException.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/base/ExitException.php#L19) |

ExitException represents a normal termination of an application.

Do not catch ExitException. Yii will handle this exception to terminate the application gracefully.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-statusCode"></span>`$statusCode` | `int` | The exit status code Default: `null`. | `ExitException` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Constructor. | `ExitException` |

## Method details

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

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

Constructor.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$status` | `int` | The exit status code |
| `$message` | `string` | 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. |