Chapter 9. Trapping Errors by Using Structured Error Handling

After completing this chapter, you will be able to:

  • Manage run-time errors by using the Try...Catch error handler.

  • Create a disc drive error handler that tests specific error conditions by using the Catch When statement.

  • Write complex error handlers that use the Err object and Err.Number and Err.Description properties to identify exceptions.

  • Build nested Try...Catch statements.

  • Use error handlers in combination with defensive programming techniques.

  • Leave error handlers prematurely by using the Exit Try statement.

In Chapter 8, you learned how to recognize run-time errors in a Microsoft Visual Basic program and how to locate logic errors and other defects in your program code by using the ...

Get Microsoft® Visual Basic® 2005 Step by Step, 3rd Edition now with the O’Reilly learning platform.

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