# Exception

> Exception represents a generic exception for all purposes.

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

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

11 subclasses:

- [`InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md)
- [`NotSupportedException`](/docs/api/yii/base/notsupportedexception/index.md)
- [`UnknownClassException`](/docs/api/yii/base/unknownclassexception/index.md)
- [`UnknownPropertyException`](/docs/api/yii/base/unknownpropertyexception/index.md)
- [`UserException`](/docs/api/yii/base/userexception/index.md)
- [`yii\db\Exception`](/docs/api/yii/db/exception/index.md)
- [`yii\log\LogRuntimeException`](/docs/api/yii/log/logruntimeexception/index.md)
- [`yii\web\HeadersAlreadySentException`](/docs/api/yii/web/headersalreadysentexception/index.md)
- [`yii\web\UrlNormalizerRedirectException`](/docs/api/yii/web/urlnormalizerredirectexception/index.md)
- [`yii2\extensions\psrbridge\exception\HeadersAlreadySentException`](/docs/extensions/psr-bridge/reference/exception/headersalreadysentexception/index.md)
- [`yii2\extensions\psrbridge\exception\OutputAlreadySentException`](/docs/extensions/psr-bridge/reference/exception/outputalreadysentexception/index.md)

Exception represents a generic exception for all purposes.

For more details and usage information on Exception, see the [guide article on handling errors](/docs/guide/runtime-handling-errors/index.md).

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getName()`](#method-getName) |  | `Exception` |

## Method details

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

```php
public function getName(): string
```

**Returns**

`string`: The user-friendly name of this exception