# UserException

> UserException is the base class for exceptions that are meant to be shown to end users.

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

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

3 subclasses:

- [`InvalidRouteException`](/docs/api/yii/base/invalidrouteexception/index.md)
- [`yii\console\Exception`](/docs/api/yii/console/exception/index.md)
- [`yii\web\HttpException`](/docs/api/yii/web/httpexception/index.md)

UserException is the base class for exceptions that are meant to be shown to end users.

Such exceptions are often caused by mistakes of end users.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-getName"></span>[`getName()`](/docs/api/yii/base/exception/index.md#method-getName) |  | [`Exception`](/docs/api/yii/base/exception/index.md) |