ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code Inspection: Empty general catch clause

Last modified: 08 March 2021

Consider the following code snippet:

In this snippet, the catch clause catches absolutely all errors. Since a non-response to an exception is a fairly rare (and potentially dangerous) thing, ReSharper warns about this and offers to catch an Exception. There are, however, usages of a catch-all statement that are justified.