Catch Clause Without Variable - prodot/ReCommended-Extension GitHub Wiki

Catching the Exception without declaring an exception variable

try
{
    ...
}
catch (Exception) // '(Exception)' is redundant
{
    ...
}

is redundant and can be omitted:

try
{
    ...
}
catch
{
    ...
}

Tip

A quick fix is available to remove the exception type declaration.

Note

The analyzer can be configured or deactivated in the ReSharper Options or Rider Settings dialog.

⚠️ **GitHub.com Fallback** ⚠️