Find catch (e: Exception) clauses whose body never references e

Proprietary

If the catch body never reads the bound exception parameter — and there's still some statement that handles the recovery — the binding name is dead weight. Use catch (_: Exception) to make 'I have no use for the exception' explicit, and so future readers don't waste time looking for where e gets used.

org.openrewrite.kotlin.functional.FindCatchBindingUnusedException$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.functional.FindCatchBindingUnusedException$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.