Open Evangelink opened 2 years ago
@buyaa-n Any opinion?
Hello,
I want to up this topic. Agree that rethrow in finally might be a normal exception flow. For example:
//Open connection
try
{
//Write data to connection
}
finally
{
try
{
//Close connection
}
catch (Exception ex)
{
//Report detailed issue on closing connection
throw; //Rethrow exception to cancel further execution flow
}
}
Analyzer
Diagnostic ID: CA2219
Describe the improvement
I'd like to suggest to relax the rule to not report in case of a rethrow inside a try/catch within the finally clause.