> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Throw-New-Errors

#### Sourcery rule id: `throw-new-errors`

#### Description

New errors should not be created without being thrown.


#### Match

```javascript
new Error("whatever");
```



#### Explanation

Although it is valid to construct an error without throwing it, this behaviour is likely unintended: errors
must be explicitly thrown.
