views:

55

answers:

3

Suppose there is a .NET application that uses lots of system events and framework methods. I find it hard to manually read the documentation of each event and method to see if they throw exceptions. Is there a VS tool or a third-party application that runs through source code and indicates which events, methods, etc. are not exception handled?

+1  A: 

Reflector has an Analyze command that may be useful for this purpose, but its not going to be as slick and quick as you would probably like

StingyJack
+4  A: 

Redgate have a tool that does this, called Exception Hunter, though you will possibly drown in a sea of possible exceptions...

Oded
+1  A: 

The most effective way is if the developer of the library uses the document comments to show what exception can be raised from a given method, but the assumes the developer bothered.

As StingyJack said the most likely way to get this information is to use reflection, this will need to be a recursive search and could tack some time, it probably will not show you any COM or Win32 Exceptions but should help you a lot.

Personally i would just wrap blocks of code in a try block and handle exceptions i know about and have a general catch all if it is that important.

Robert
Right - there's no point in catching specific exceptions if you can't do anything useful with them
Tim Robinson