Project Description

This is a plugin for great ReSharper product. The main purpose for that plugin is to aid developers to analyse thrown exceptions and provide some guidance about them. It introduces the notion of checked exception that you may know from Java to C#.


Working with a code base (whether it is a small one or a big one) I constantly encounter issues caused by wrong exception handling. You may have a super exception handling policy, but it is the developer who must execute this policy on it's own code. You may have automatic policy checking but again it is the developer who will have to fix those violations. Even with no policy defined there are good practices on how to properly handle exceptions. This Exceptional plug-in will allow you to seamlessly apply these good practices right into your code base with couple of key strokes.
Generally we should document our public API and I consider thrown exceptions documentation important. But even if documenting thrown exceptions is pretty easy the maintenance of the code that is using a particular method is not. While developing our functionality we use methods and properties on classes from other modules or core .Net Framework components. If they are documented properly we can see in intellisense that they throw exceptions or not. We can then take it into account. But then after a month or two when other team member will update the method that we are relying on and throw another exception we will not be warned. Here Exceptional plug-in comes into the game. He will analyze call sites and provide hints on exceptions thrown from that invocations. If you catch them or have them documented in your method that's fine. But if you miss something you will be proposed to either catch that exception or document it as thrown.


Analyze exceptions thrown from method or property (only public, protected or internal).

Exceptions thrown outside the scope of method\property that are not documented in methods xml documentation (thrown with use of throw keyword).

Fix: Document or catch thrown exception.

Exceptions thrown outside the scope of method\property that are not documented in methods xml documentation (thrown from another invocation).

Fix: Document or catch thrown exception.

Exceptions documented in xml documentation that are not thrown from method/property.

Fix: Remove documentation of not thrown exception.

Analyze catch clauses

General catch-all clauses should be avoided.

Throwing new exception from catch clause should include message and inner exception.

Fix: Include inner exception from outer catch clause.

More features to come!

Last edited Mar 22, 2009 at 11:20 PM by nuwanda, version 24