Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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 :
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 :
Use 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| '-------------------+--------+-------+--------------+------+------------------------------------'
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 :
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 :
Use 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| '-------------------+--------+-------+--------------+------+------------------------------------'
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.