Find broad catch (e: Exception) / catch (e: Throwable) clauses
Proprietarycatch (e: Exception) catches almost everything — IllegalArgumentException, ConcurrentModificationException, even programmer-error NullPointerException. catch (e: Throwable) is worse: it catches OutOfMemoryError and kotlinx.coroutines.CancellationException. Each broad catch is a candidate for narrowing to the specific exceptions the surrounding code is prepared to handle.
org. openrewrite. kotlin. functional. FindCatchAllException$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. functional. FindCatchAllException$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.