Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 881 Bytes

RCS1236.md

File metadata and controls

47 lines (36 loc) · 881 Bytes

RCS1236: Use exception filter

Property Value
Id RCS1236
Category Usage
Severity Info
Minimal Language Version 6.0

Example

Code with Diagnostic

try
{
}
catch (Exception ex)
{
    if (!(ex is InvalidOperationException)) // RCS1236
    {
        throw;
    }

    return;
}

Code with Fix

try
{
}
catch (Exception ex) when (ex is InvalidOperationException)
{
    return;
}

See Also

(Generated with DotMarkdown)