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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.