ASP.NET Developer's JumpStart By Paul D. Sheriff, Ken Getz
Table of Contents
Chapter 12. Error Handling
In this chapter you learned how to use the new structured exception handling that is pervasive through the .NET Framework. You will find this type of error handling much more powerful than the On Error GoTo structure you were forced to use in VB. And of course, it is much better than the On Error Resume Next of ASP. In this chapter, you learned the following:
How to use a Try block to add exception handling to a block of code.
How to add Catch blocks, as necessary, to trap individual exceptions.
The .NET runtime handles Catch blocks in order, looking for an "is a" match against the current exception. It uses the first block it finds that matches.
How to nest Try blocks, making it easy to effectively "push" and "pop" exception-handling states.
How to add a Finally block to your Try block to run code unconditionally, whether an error occurs or not.