I've got a bunch of scripts that get run on end-user machines, and if a condition occurs that I didn't think to handle (ahem) the user gets a dialog on their screen telling them there was an AutoIt error -- not desirable!
Having had a dig around, I've found the OnExitFunc option, which sounded like it might allow me to hide the error message, however it either doesn't work that way or I'm not using it correctly:
Opt("OnExitFunc", "myExitFunction")
callInvalidFunction()
Func myExitFunctio