Feature Request - Exception list for a method

I'd love to be able to get a list of all possible exceptions that could be thrown by the code within a method.  Bonus to be able to add try/catch via list.  What I'm envisioing is right-clicking method name and clicking on 'Get Exception List' or something like that.

Possible already?  Found a couple similar requests that seem to have gone unheeded.  This doesn't seem like it would be too complicated.

Thoughts?

2 comments
This doesn't seem like it would be too complicated.


Really? You wouldn't just be looking for "throw new BlahException()" and "throw MySuperSweetUtilities.CreateBlahException()"; you'd have to check every call made by the method - other methods, property accessors, P/Invoke calls, native calls, etc. - to find any exceptions they might throw, and filter out any that would be caught and not re-thrown. That seems quite complicated to me!

0

To work with exception there are some helpfull addins already.

First one is an addin called exceptional http://exceptionalplugin.codeplex.com/ which gives you a warning when you do not handle exceptions that are documented on a method.
You could extend it to show you all exceptions you are not caught if it does not do it already. I have not used it for a while.

The second one  is agent johnson http://code.google.com/p/agentjohnsonplugin/ where you have a quick fix to add xml comments for uncaught exceptions. It is possible that exceptional already contains such quick fix.

0

Please sign in to leave a comment.