SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Raise Error Processing or stop script processing

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Raise Error Processing or stop script processing
Author Message
SchedulerDude



Joined: 27 Apr 2015
Posts: 18
Country: Canada

Post Raise Error Processing or stop script processing Reply with quote
We have a job that connects to a database (MS Access) and reads a table then process other tasks. The connection to the DB is though ODBC.

We would like to put some code in our JAL script to handle errors. For example, ODBC failed make connection (i.e. would like to kill the process, raise an error and email error message like the generic error execution notifications, and stop the running of the script/job). Or Unable to find table, or zero records retrieved, etc.

There are other errors that we would like to trap also but once I get the basic principal of raising errors, etc. I think I can figure it out.

Thanks.
Thu Mar 02, 2017 2:45 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7833

Post Reply with quote
In JAL you can use OnErrorGoTo label_here before calling a statement that you expect to fail. This way if it fails you can redirect execution to a section of your code for handling errors. Of course you may have multiple sections for handling different kind of errors, for example a section for handling connection errors and a separate section for handling data errors.

Every error handling section should start with OnErrorStop statement. Failure to reference that statement may lead to infinite lol if an error occurs within the error handling section.

For a conceptual example see page 29 in 24x7JALScript.pdf.

If coding in 24x7 JavaScript, you can use the standard try...catch... method.
Thu Mar 02, 2017 3:48 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.