cwswitch
Member
Posts: 78 Joined: Fri Feb 24, 2017 12:25 am
Post
by cwswitch » Wed Aug 22, 2018 3:14 am
I have scripts that are designed to throw errors
Code: Select all
if (result !== "Success") {
throw new Error("Message: " + result);
}
return result;
}
Can I catch this error in Switch and send the job off elsewhere instead of it just failing at this point?
r.zegwaard
Member
Posts: 93 Joined: Fri Jul 08, 2011 10:31 am
Location: The Netherlands
Post
by r.zegwaard » Wed Aug 22, 2018 7:33 am
If you set the connection-type of the script to "Traffic-light", you can send the job the the success, warning or error-connection, depending of the result of your script.
See
http://www.enfocus.com/manuals/Develope ... /home.html
topics:
Developing a scripts > Script declaration > Main script properties --- Connection type
Scripting reference > Flow element module > Job class --- Sending jobs to outgoing connections