One Star

throwing exceptions in subjobs

For logging purposes I use the OnSubjobError and OnSubjobOk. If an error occurs I write this error to a logfile.
During the project I found out that, if I use these triggers in a sub tRunJob, the parent job does not fire OnSubjobError.
Take for example a parent job (job1):
tRunJob (job2) ---- onSubjobError ----> tMsgBox('job2 gives errors')

Take for the second job (job2):
tOracleConnection ----OnSubjobError---> tMsgBox('no connection')

Imagine that job2 cannot retrieve the oracle server: the subjob gives an error and shows the message box 'no connection'. But the message 'job2 gives errors' is never displayed. How does that come?
2 REPLIES
One Star

Re: throwing exceptions in subjobs

My question is in fact: How can I log the error in the second job AND, at the same time, let the parent job flow into a onSubjobError too?
Seven Stars

Re: throwing exceptions in subjobs

When you use an OnSubjobError link in a child job, it is the result of the processing after that link that is passed back to the parent. So no problem logging the error in the child job means no error in the tRunJob.
To force an error in the tRunJob in this scenario, you need a tDie as the last component after logging the error in the child job.