Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Every programmer, no matter how good he or she may be, runs into errors when writing and testing scripts and programs. Like any other programming language, VBScript is subject to many types of errors. Errors may be inevitable, but you can minimize their number or lessen their effects. In this chapter, I’ll demonstrate a number of scripting errors and show you how to deal with them. Specifically, you will learn how to
Fix errors by reading and analyzing error messages
Write VBScripts that can ignore errors and keep going
Create error-handling routines to recover from many error situations
Generate test errors in order to validate the performance of your errorhandling routines
Keep a record of errors using log files and the Windows application event log