Using: SonarLint for Visual Studio 2019 v. 4.37
If I have
try
{
some code;
}
catch (Exception e)
{
if (some condition)
throw;
}
it doesn’t complain, but if I move the condition in the when clause:
try
{
some code;
}
catch (Exception e) when (some condition)
{
throw;
}
then it does complain with Rules explorer
If having a condition in the catch body before the rethrow is sufficient to avoid RSPEC-2737, having the same condition in the when clause should probably have the same effect.
