# InvalidRouteException

> InvalidRouteException represents an exception caused by an invalid route.

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

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

InvalidRouteException represents an exception caused by an invalid route.

## Methods

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

## Method details

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

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

**Returns**

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