Find runCatching { } blocks that may swallow CancellationException

Proprietary

runCatching { } catches every Throwable, including kotlinx.coroutines.CancellationException. Inside a coroutine that's a bug — CancellationException is the cooperative-cancellation signal, and swallowing it stops the coroutine from cancelling. Either avoid runCatching in suspending code, or rethrow with .onFailure { if (it is CancellationException) throw it } before any other handling.

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