Explanation

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.


Suggested Action

  1. 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.

  2. Perform error cleanup, if needed.

  3. 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.