Is there a way in VS2008 (c#) to see all the possible exception types that can originate from a meth

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2010-05-20T19:06:40Z Indexed on 2010/05/20 19:10 UTC
Read the original article Hit count: 149

Is there a way in VS2008 IDE for c# to see all the possible exception types that can possibly originate from a method call or even for an entire try-catch block?

I know that intellisense or the object browser tells me this method can throw these types of exceptions but is there another way than using the object browser everytime? Something more accessible when coding? Furthermore, I don't think intellisense or the object browser do anything more than read the XML code comments.

Shouldn't it be possible to scan a class's source and find all the exception types that can be thrown. (Forget path-ing based on method input, just scan the code for exception types)

Am I wrong? Extending this idea, you should be able to hover over the 'try' or 'catch' keywords and present a tooltip with all the types of exceptions that can be thrown.

My question boils down to, does a VS2008 add on like this exist? Does VS2010 do this perhaps? If not, could you implement it the way I've described, by scanning the class code for thrown exception types and would people find it useful. Exceptions bubble up so you have to scan every bit of code every method call, which I guess could be impractical, though I suppose you could build an index the first time and increase your speed that way.

(It might be a cool little project....)

© Stack Overflow or respective owner

Related posts about visual-studio-2008

Related posts about exception