SonarSource/sonar-dotnet

Fix S1854 FP: Throw should connect to outer catch

pavel-mikula-sonarsource opened this issue · 0 comments

This is similar to #9466

    public void NestedCatchAndRethrow()
    {
        var value = 100;
        try
        {
            try
            {
                CanThrow();
            }
            catch
            {
                value = 200;    // Noncompliant FP
                throw;
            }
        }
        catch
        {
            Log(value);
        }
    }