Find throw/catch shape smells

Proprietary

Search-only bundle for throw shapes inside catch blocks: bare-RuntimeException/Exception wrappers that discard contextual messages, useless catch { throw e } blocks, and rethrows of new exception types that don't pass the caught exception as cause.

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

Recipe list

It runs these recipes, in this order.

  1. Find throw RuntimeException(e) inside a catch block
  2. Find catch (e: Exception) { throw e } patterns
  3. Find catch (e: Exception) { throw OtherException(...) } without e as cause