-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
False PositiveRule IS triggered when it shouldn't be.Rule IS triggered when it shouldn't be.
Milestone
Description
Description
S2737 is raised in the following circumstance:
try
{
}
catch (Exception ex) when (LogException(ex))
{
throw;
}
In this case LogException always returns false and therefore the catch should always be skipped but just in case the LogException function has a bug we place throw there.
Repro steps
See Description.
Expected behavior
No warnings for catch statement with exception filter.
Actual behavior
S2737 is raised for catch with exception filter.
Known workarounds
Suppression.
Related information
- C#/VB.NET Plugins version
- Visual Studio version
- MSBuild / dotnet version
- SonarScanner for .NET version (if used)
- Operating System
Metadata
Metadata
Assignees
Labels
False PositiveRule IS triggered when it shouldn't be.Rule IS triggered when it shouldn't be.