Property | Value |
---|---|
Id | RCS1236 |
Severity | Info |
Minimum language version | 6.0 |
try
{
}
catch (Exception ex)
{
if (!(ex is InvalidOperationException)) // RCS1236
{
throw;
}
return;
}
try
{
}
catch (Exception ex) when (ex is InvalidOperationException)
{
return;
}
The accepted answer from Stack Overflow states:
"If there is an exception thrown within the filter, then that exception will be silently swallowed and the filter simply fails."
It is impossible to definitely detect if an exception can be thrown within an expression.
So the expression is considered as the one that can throw an exception if it contains method call that meets one of the following requirements:
- Its name starts with
ThrowIf
. - Its XML comment contains
<exception>
element. (Generated with DotMarkdown)