tags:

views:

84

answers:

3

Hello,

Does anyone know of a program or plug-in or anything that I can find out what are all the exceptions any method may throw?

I think JAVA has this build in if I'm not mistaken. Where the compiler tells you what exceptions this method will throw.

Does the same exist for .NET?

Thanks

Edit: After searching around more, I wish there was tool like Object Explorer, except for Exceptions. You select the class or method and it lists the exceptions, at that level, which are thrown by the class. The tool links provided are a great start. Thanks!

A: 

You can see this information with intellisense in Visual Studio. When you highlight a method name in the intellisense list, its description should contain a list of exceptions at the bottom. This information is added by properly commenting your methods and classes. If you are using a library that is not part of the framework, then you will only get this information if the developers of the library appropriately commented their code.

Kevin Babcock
+2  A: 

I don't know if this is exactly what you are looking for, but:

http://www.red-gate.com/Products/Exception_Hunter/index.htm

Note: I've never used the product, and I don't work for Red Gate, I just remember seeing it advertised before.

FryGuy
A: 

.NET doesn't require or permit each method to state which exceptions it throws. As I recall, it was felt that this would lead most developers to simply state "throws Exception".

John Saunders
And we thank them for it!
Ben Daniel