Error Handling when writing to output file
I have a QTP script that writes output to a text file that is located on my company's network. The file is opened at the start of the script and remains open through the life of the script. The script writes output to it for every iteration through the data table.
This script runs everyday all day and has been doing so for nine months without fail. In the last few days, the network has been flakey. Because of that, there are times when the output cannot be written. I need to be able to capture this fact.
Since VBScript is limited in error handling, I can only tell the script to On Error Resume Next. With full-blown VB, the error number can be captured in the error handler making error handling a snap. I don't have the ability with script.
What's the best way to handle a Write error in VBScript? I want to be able to elegantly stop the script when this happens, but have not found a way to do that.
Any help with this would be very much appreciated.
Re: Error Handling when writing to output file
vbscript has error number, err.number. look up the "err" object