Page 1 of 1

Exception in Exception handle

Posted: Mon Nov 04, 2013 12:58 am
by bondlee
Hi,

I have spotted a strange, but not impossible, scenario in a job sequence that has a user defined exception handler.

When an exception occurs in a job sequence, the code under exception handler gets executed. But the interesting thing to know is what happens when the code under that ex handler encounters another exception...? The sequence gets aborted irrespective of Terminator stage usage in ex handle.

Any one has an idea to prevent the sequence from aborting when such scenario occurs?

Posted: Mon Nov 04, 2013 7:57 am
by ray.wurlod
Prevention is always better than cure. Don't write them that way. What kind of activity under the "exception being handled" stream is aborting?

Posted: Mon Nov 04, 2013 9:32 am
by bondlee
Hi Ray,

If it is something that I can control, that would have been my first choice. To give more details, there is a job that is being called under ex handle stream. If that job is not in runnable state or if one of its parameters can't be set, that results in exception under the ex handle stream. Logically the same reason would have raised the first exception as the same job would have been part of main stream too.

In my case, there is a parameter that needs to be generated before it is passed to a job and if it can't be generated, that would raise exceptions wherever it is expected including ex handler.

Thus I didn't see any way out here to prevent abortion. So thought of giving a try with rest of the world.

Posted: Mon Nov 04, 2013 9:39 am
by kduke
There is probably two things happening here. Did you check automatically handle exceptions in job properties? This will force aborts on jobs aborting. Did you check the job restartability? This will skip successful steps when rerunning. This means the step where you calculated the job parameter value may get skipped when rerunning.

Posted: Mon Nov 04, 2013 9:42 am
by bondlee
I did un-check the 'automatically handle exceptions'. No problems with restartability.

Posted: Mon Nov 04, 2013 9:51 am
by asorrell
The product is designed that way to keep an infinite loop from occurring when the exception handler code generates an exception.

As said earlier, that's why you make very sure the exception handler code is minimal and very clean. I typically don't run ANY jobs in my exception handlers. I just send email and stop.

Posted: Mon Nov 04, 2013 7:39 pm
by bondlee
Thanks for the reply. I did think the same but just wanted to see if I was missing any possible setting to make the sequence end gracefully rather than abort. That is a master sequence with no parent and needs manual intervention to reset.

Anyway, thanks for your interest.