Page 1 of 1

Pushing errors to Error out

Posted: Sun Jan 13, 2019 11:35 pm
by cwswitch
Hello,

Can I push any error in a script to the error out connector?

Or must I have a try catch and the catch pushes the error the way I want?

If try/catch was the way, then do I copy the problem bit of code like this?

Code: Select all

	try {
		problem code in its entirety even if it is several lines long;
	} catch (e) {
		job.sendToData( 3, job.getPath() );
	}
Ideally -
What I'd really like is a neat way to capture any error whatsoever and have it push to Error Out

Re: Pushing errors to Error out

Posted: Mon Jan 14, 2019 8:39 am
by Padawan
Your code looks like it will work (assuming of course you have set the outgoing connection to be traffic light). Personally, I would add a line to log your exception in the Switch messages.

Code: Select all

	try {
		//problem code in its entirety even if it is several lines long;
	} catch (e) {
		job.log(3, e);
		job.sendToData( 3, job.getPath() );
	}