Use rethrow instead of throw ex

Proprietary

Replace throw ex; with throw; inside catch clauses when ex is the caught exception variable. A bare throw preserves the original stack trace.

OpenRewrite.Recipes.CSharp.CodeQuality.Redundancy.UseRethrow
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Redundancy.UseRethrow

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