Use rethrow instead of throw ex
ProprietaryReplace 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. UseRethrowmod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Redundancy. UseRethrowInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.