"
finally
block should not be empty"
By using a finally
block, you can clean up any resources that are allocated in a try
block, and you can run code even if an exception occurs in the try
block. If the finally statement is empty, it means that you don't need this block at all.
public void Bar()
{
try
{
...
}
catch (Exception)
{
...
}
finally
{
}
...
}
should be 🡻
public void Bar()
{
try
{
...
}
catch (Exception)
{
...
}
finally
{
...
}
}
public void Foo()
{
try
{
...
}
catch (Exception)
{
...
}
finally
{
}
}
should be 🡻
public void Foo()
{
try
{
...
}
catch (Exception)
{
...
}
}