I have an error handler set up that attempts to close the window and elegantly back out of the script. On occasion, the window it's attempting to close can't be found, and it enters a loop in outputting to the error log.
Here's the pertinent script pieces:
Code: Select all
// first two executable lines:
Let>IGNOREERRORS=0
Let>ONERROR=errorHandler
// script body here
SRT>errorHandler
Let>IGNOREERRORS=1 // note ignore errors
Let>ErrMsg=LAST_ERROR_LINE
ConCat>ErrMsg,": "
ConCat>ErrMsg,LAST_ERROR
Timestamp>%SCRIPT_DIR%\error.log,ErrMsg
CloseWindow>windowTitle // line 363
Wait>5
Exit>0
END>errorHandler
Code: Select all
14:03:50:616 - 363": "Specified Window "[windowname]" Not Present.
Any Subsequent Key Sends In Script May Cause Exceptions.
14:03:50:834 - 363": "Specified Window "[windowname]" Not Present.
Any Subsequent Key Sends In Script May Cause Exceptions.
.. etc etc
I would have expected the IGNOREERRORS=1 statement at the start of the error handler to ignore that error from CloseWindow and just continue trying to exit the script instead of recursing itself.
Any ideas on how I can stop this behavior? I can try moving the CloseWindow command to it's own SRT and put the IGNOREERRORS in there, but I'm curious if there's some known issue with this in a handler or if I'm missing something obvious?
Thanks,
-jack