Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Catch an exception caused by a subjob

Hi everyone.

 

I have a situation when one of the subjobs causes a random exception caused by remote server. This specific exception is non-critical and what I'd like to do is to check the exception type and continue if it's the non-critical one. I. e. in Java i'd do it in the following way:

 

try

{

//Run the subjob here

}

catch (exception e)

{

if (!(e is MyNonCriticalException)) throw;

}

 

How can I achieve something like that using Talend components?

I know that tRunJob has "Die on child error" option. If I check it the main job crashes on child crash. If I uncheck it, the OnComponentError event is not triggered and I cannot check the exception type. Any suggestions?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

You can use a tLogCatcher and a tBufferOutput to catch your error and ride it up to the father job.

You can inspire from this example : 

logcatcher.PNGlogcatchertmap1.PNG

In this example i want to ride up the NumberFormatException errors from the component tMap_1.

On your father job, read your errors like this :

 

ftherjoblogcatcher.PNGUse the same schema in this link as the tbufferoutputschema

.-------------------+--------+-------+--------------+------+------------------------------------.
|                                      __UNIQUE_NAME__<br>                                      |
|=------------------+--------+-------+--------------+------+-----------------------------------=|
|moment             |project |job    |type          |origin|message                             |
|=------------------+--------+-------+--------------+------+-----------------------------------=|
|2020-02-03 17:56:05|PROJECT |testt  |Java Exception|tMap_1|java.lang.NumberFormatException:null|
'-------------------+--------+-------+--------------+------+------------------------------------'

 

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,

 

You can use a tLogCatcher and a tBufferOutput to catch your error and ride it up to the father job.

You can inspire from this example : 

logcatcher.PNGlogcatchertmap1.PNG

In this example i want to ride up the NumberFormatException errors from the component tMap_1.

On your father job, read your errors like this :

 

ftherjoblogcatcher.PNGUse the same schema in this link as the tbufferoutputschema

.-------------------+--------+-------+--------------+------+------------------------------------.
|                                      __UNIQUE_NAME__<br>                                      |
|=------------------+--------+-------+--------------+------+-----------------------------------=|
|moment             |project |job    |type          |origin|message                             |
|=------------------+--------+-------+--------------+------+-----------------------------------=|
|2020-02-03 17:56:05|PROJECT |testt  |Java Exception|tMap_1|java.lang.NumberFormatException:null|
'-------------------+--------+-------+--------------+------+------------------------------------'

 

Anonymous
Not applicable
Author

Thank you for your reply, that's almost exactly what I needed. I'll use tJavaFlex to analyze the returned error instead of tLogRow and that'll do it.