Summary
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. ...
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