Exception handling when running scripts via RunCode

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
geoffwoz
Newbie
Posts: 8
Joined: Tue Jan 13, 2015 11:59 am

Exception handling when running scripts via RunCode

Post by geoffwoz » Tue Jan 13, 2015 12:16 pm

We have an embedded solution utilising macroscript dll from within which we run our scripts.

The problem we have is the default handling of exceptions (eg. SetFocus when a window doesn't exist) is to popup a dialog with the error string and wait for the user to respond to the Cancel/OK options.

We would like to capture the error (don't want to ignore it), but dont' want it to stop execution waiting for user input (which won't come as our automation is not human assisted).

Is there a way to handle these errors in the script, or ideally (I'll raise through a separate feature request if not possible) to have a callback from the macroscript DLL to allow for programmatic handling of the error situation.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Exception handling when running scripts via RunCode

Post by Marcus Tettmar » Tue Jan 13, 2015 1:39 pm

Yes, you can ignore errors or use your own custom error handlers. Please see "Error Handling" in the command reference:

https://www.mjtnet.com/manual/index.htm ... ndling.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

geoffwoz
Newbie
Posts: 8
Joined: Tue Jan 13, 2015 11:59 am

Re: Exception handling when running scripts via RunCode

Post by geoffwoz » Sun Jan 18, 2015 2:33 am

Thanks marcus I will look into the handler... Just as an aside when I followed the link I got the following error from the site:

Site error: the file /var/www/vhosts/cloud.mjtnet.com/mjtnet.com/comments/init-settings.php requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.

Not sure if that's an issue on my side..

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Exception handling when running scripts via RunCode

Post by Marcus Tettmar » Mon Jan 19, 2015 12:34 pm

Sorry about that. This is now fixed. Page should load fine now.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts