A try
statement
appears with no corresponding catch
block; therefore, the code will not capture the
error. Although this is valid code, it is not recommended, even if you know what
the error is or are not concerned with what it is.
Use a catch
block and place an identifier
after the catch
keyword.
When the catch
block executes, the identifier
is set to an object that contains the message, message ID, and call
stack.
Perform error cleanup, if needed.
Use the message ID as an argument to the
rethrow
function.
Ideally, check the message ID for all errors (including those you want to ignore, so as to avoid masking serious low-level errors).
(For more information see the documentation for rethrow
and MException
.)
To disregard this suggestion, suppress the warning message, as described in Adjust Code Analyzer Message Indicators and Messages.