Find try { } catch { } nested inside another try { } catch { }

Proprietary

A try nested inside another try usually means two failure modes are being handled at two different recovery points in the same control-flow tree. Pull each failure mode into its own helper function (or into a runCatching { }.fold(...) chain) so the recovery strategy is visible at each level.

org.openrewrite.kotlin.functional.FindNestedTryCatch$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.functional.FindNestedTryCatch$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.