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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access