tags:

views:

453

answers:

3

I'm switching back and forth between Java and C# and one thing I miss while I'm coding in C# is the enforced exception checking (Although I admit I also find it really irritating sometimes while I'm coding in Java).

I'm aware that Exception Hunter can help you track down what exceptions a piece of code might throw but is there a free/cheaper alternative? I can't really justify £200 for this kind of software addon as it's only an annoyance rather than a major problem.

A: 

While I understand the enforced exceptions thing, I'm not sure how genuinely essential it is... for example, most interesting exceptions are those that you wouldn't normally include (or even expect). For example, I'm currently fighting what looks very much like a CLI bug in CF35, intermittently raising MethodMissingException from code that really does exist (emphasis: intermittently).

If you want to document your exceptions, use the ///<exception ... >...</exception> markup. For other thoughts on this theme, perhaps see Vexing Exceptions (I wonder if GhostDoc might help any?)

Marc Gravell
A: 

Get Exceptional website is one possibility. Basic idea is that you create software and all exceptions are sent to this site to your account where you can pick them up. Of course it doesn't read your code and see what exceptions are there.

I don't know if there is C# library yet but the API is not too hard.

raspi
+2  A: 

Yes. Run the free Microsoft Pex on your code. It will show all possible exceptions that can be thrown.

Judah Himango
Looks like a great tool, thanks for the link. Pity the commercial version only works with VS Team edition.
Dave
If you don't have the Team edition of VS, you can still use the tool from the command line. It generates HTML output I think.
Judah Himango