Documenting Exceptions

added by BlackWasp
2/16/2012 9:38:17 AM


Code can be decorated with XML documentation comments, which can be compiled into documentation files. When members can throw exceptions, the comments can include a description of each expected exception and the reasons why it may be thrown.


2/16/2012 9:39:56 AM
I really wish more open source projects would take advantage of not only XML generated documentation, but specifically documenting the types of exceptions the code may throw. I've had issues where after weeks in production an app will suddenly receive a fatal exception for something as simple as the network connection being interrupted. Had I known the developer was going to throw an exception in that situation I would have tried to trap it locally and allow the program a chance to recover, rather than going through a failsafe procedure and closing.

2/16/2012 2:06:06 PM
I know that feeling :)