Use rethrow instead of throw ex
Recipe ID
OpenRewrite.Recipes.CSharp.CodeQuality.Redundancy.UseRethrowArtifactOpenRewrite.Recipes.CSharp.CodeQualityReplace throw ex; with throw; inside catch clauses when ex is the caught exception variable. A bare throw preserves the original stack trace.
Single recipecsharpcode-qualityProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Redundancy.UseRethrowIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality