Prefer functional error handling over throw expressions

Proprietary

Finds throw expressions inside method bodies that should use functional error handling. Throwing exceptions breaks referential transparency; prefer returning Try, Either, or Option.

org.openrewrite.scala.errorhandling.PreferFunctionalErrorHandling
mod run . --recipe=org.openrewrite.scala.errorhandling.PreferFunctionalErrorHandling

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.