Flatten-Nested-Try
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.
Sourcery rule id: flatten-nested-try
Section titled “Sourcery rule id: flatten-nested-try”Description
Section titled “Description”Merge nested try-statement into a single try
Before
Section titled “Before”try { try { something() } catch (e) { catching() }} finally { finalling()}try { something()} catch (e) { catching()} finally { finalling()}Explanation
Section titled “Explanation”Flattening try…catch statements nested within a try…finally generates equivalent code that is easier to read and expand upon.