Archive

Posts Tagged ‘Inheritance’

When to use custom exceptions

June 12, 2011 Leave a comment

Have you ever found yourself in a situation where there seems to be no exception type that is a fit for the exception you want to throw? In smaller, stand-alone projects it is easy to just ignore the problem and use a plain old, generic Exception. After all, you’re the only one who’s going to see it, right? For larger, more complex projects or for class libraries that will be consumed by other assemblies that may not be written by you it can be useful or necessary to throw exceptions that have targeted meaning. The solution is to make your own, and the .NET framework has provided us the means. Read more…

Advertisements