Chapter 7. Exceptions

In an ideal world, all programs would execute perfectly and always produce the correct value. In reality, however, bugs and other unexpected situations happen. These situations are dealt with in the .NET Framework through exceptions. An exception is an object that represents an unexpected or exceptional situation. An exception contains information that can be used to help understand what went wrong and where. When an error condition occurs in a program or in the Framework, a new exception object is created and thrown. Throwing an exception causes the program to stop executing and passes control to the .NET Framework, which looks for a specific kind of code, called an exception handler, which can catch the exception and handle ...

Get Visual Basic .NET Programming Language, The 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.