We’ve just been writing some new exceptions based initially on an abstract Exception class. When the attempt to write a catch statement to catch all exceptions which inherited from this abstract base class it wasn’t behaving as expected.

The gotcha here is that C#/.NET doesn’t allow you to catch exceptions from an abstract class. If you want to catch a base class Exception, avoid that abstract.

You have been warned! This is for .NET 2 by the way :)

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>