> ## 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.

# Flatten-Nested-Try

#### Sourcery rule id: `flatten-nested-try`

#### Description

Merge nested try-statement into a single try


#### Before

```javascript
try {
    try {
        something()
    } catch (e) {
        catching()
    }
} finally {
    finalling()
}
```

#### After

```javascript
try {
    something()
} catch (e) {
    catching()
} finally {
    finalling()
}
```



#### Explanation

Flattening try...catch statements nested within a try...finally generates
equivalent code that is easier to read and expand upon.
