Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my main job, I have OnComponentError routed to tDie components in a few places. I also have a joblet set up to listen to Java Exceptions via the tLogCatcher. The joblet handles emailing, logging, and also has a tDie component at the end of it so the job completely ends on exception. My question is, if I have OnComponentError coming off a particular component, and that component fails, will it still throw an Exception for my joblet to catch or will it go to the tDie component and not hit my joblet.
My desired behavior is for all exceptions/errors to trigger the joblet so that errors get logged and emails triggered. I'm wondering if I need to avoid using "OnComponentError" flows altogether then or not.
That's super helpful, thank you!!
If I wanted to re-throw the error, which component would I use to do that?
a tJava component with something like this in it should do it for you. You'll need to double check the globalMap key's your components or jobs populate to make sure you get the right error messages.
throw new RuntimeException(((String)globalMap.get("<component_id>_ERROR_MESSAGE")));
depending on how your job is connected, you may need to wrap the throw statement in an "if" to prevent the unreachable code compile error:
if( true ) { //throw exceptions }