In Chapter 6, “Error Handling and Exceptions,” you learned about exceptions in .NET development; you saw what exceptions are and how you can intercept exceptions at runtime to create well-formed applications that can handle errors. The .NET Framework ships with hundreds of exceptions related to many aspects of .NET development. There could be situations in which you need to implement custom exceptions. Building custom exceptions is possible due to inheritance. A custom exception can inherit from the root
System.Exception class or from another exception (such as
System.IO.IOException) that necessarily inherits from
System.Exception. Custom exceptions should always be CLS-compliant. Let’s retake ...