Practical Inheritance: Building Custom Exceptions
In Chapter 6, “Errors, Exceptions, and Code Refactoring,” you learned about exceptions in .NET development; you saw what exceptions are and how you can intercept them 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. You might encounter a situation where you need to implement custom exceptions. You can build custom exceptions 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 ...
Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.