Is there a way in VS2008 (C #) to see all the possible types of exceptions that may arise from a method call or even for the whole try-catch block?

Is there a way in the VS2008 IDE for C # to see all the possible types of exceptions that may arise from a method call or even for the entire try-catch block?

I know that intellisense or the object browser tells me that this method can raise these types of exceptions, but is there any other way than using the object browser every time? Something more affordable when coding? Also, I don’t think that intellisense or the object browser do anything more than reading XML code comments.

Is it possible to scan the source code and find all types of exceptions that can be selected. (Forget the path based on the method input, just look at the code for exception types)

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

My question boils down to whether VS2008 adds something like this? Can VS2010 do this? If not, can you implement it as I described by looking at the class code for exception types, and people will find it useful. Exceptions fail, so you need to scan every bit of code for every method call, which, I think, might be impractical, although, I suppose, you could create an index for the first time and increase the speed this way.

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

+3
source share
1 answer

What you are looking for is Redut Gate Exception Hunter .

Exception Hunter , .

, IoC , :

var service = IoC.Resolve<ILogger>();
service.Log("Here");

, , ? ? ? ?

+4

Source: https://habr.com/ru/post/1746451/


All Articles