roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

Improve analyzer "Use exception filter" (RCS1236)

Open josefpihrt opened this issue 6 years ago • 0 comments
trafficstars

This

try
{
    return Load(path);
}
catch (IOException)
{
}
catch (UnauthorizedAccessException)
{
}
catch (XmlException)
{
}

can be replaced with this

try
{
    return Load(path);
}
catch (Exception ex) when (ex is IOException
    || ex is UnauthorizedAccessException
    || ex is XmlException)
{
}

josefpihrt avatar Aug 12 '19 16:08 josefpihrt