2 Replies Last post: Feb 24, 2012 6:06 PM by Sven Heitmann  
Jeff Jackson Newbie 1 posts since
Feb 23, 2012
Currently Being Moderated

Feb 23, 2012 2:57 AM

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?

Richard Deeming Novice 150 posts since
Oct 6, 2010
Currently Being Moderated
Feb 24, 2012 5:02 PM in response to: Jeff Jackson
Re: Feature Request - Exception list for a method
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!

Sven Heitmann Novice 166 posts since
Jul 3, 2009
Currently Being Moderated
Feb 24, 2012 6:17 PM in response to: Jeff Jackson
Re: Feature Request - Exception list for a method

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.

More Like This

  • Retrieving data ...