Find throw Exception(...) and throw RuntimeException(...) calls
ProprietaryThrowing a bare Exception / RuntimeException forces every caller into a generic catch. Each match is a candidate to use a more specific exception type (IllegalArgumentException, IllegalStateException, a domain-specific subclass).
org. openrewrite. kotlin. search. FindThrowGenericException$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. search. FindThrowGenericException$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.