.NET Find Eaten Exceptions

I am using .NET 4.0 with VS2010. In my current application (not written by me) I found that there are several codes, such as

Try
    ' do something '
Catch e As Exception
    ' do nothing about the exception. no logging and no re-throw... =o=!!! '
End Try

My question is how to find such an β€œeaten up” exception throughout the application.

Thank!

Edit: Sorry, I have to indicate that the Catch block is not always empty. It can sometimes be Return False, Return Nothing, Return, Return 0, Return ""...

+3
source share
5 answers

Launch FxCop through related assemblies. Look for violations of CA1031 rule .

Alternatively, you can use this regular expression in the source code:

catch:b*\([^)]*\):b*\{:b*\}
+4
+1

Visual Studio "" > "", "" " ". , , , .

+1

@RoadWarrier, FxCop, . FxCop, StyleCop, . resharper, StyleCop Resharper, .

0
source

It’s good that you have a source of the application where you can find excluded nutrition. We had to deal with a dll that eats an exception at the production stage, and we use an exception detection tool created using MDbgCore.dll

0
source

Source: https://habr.com/ru/post/1778638/


All Articles