HO to catch runtime exceptions in Talend

Seven Stars

HO to catch runtime exceptions in Talend

Hi,

 

I need to capture run time exceptions and write into file.

More precisely I need to capture java exceptions, eg error given below,

 

Exception in component tSalesforceOutput_2
java.lang.Exception: unable to obtain exclusive access to this record

    at org.talend.salesforce.SforceManagementImpl.update(SforceManagementImpl.java:416)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.tMysqlInput_1Process(a_corporate_td_to_sfdc.java:8977)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.tSalesforceConnection_1Process(a_corporate_td_to_sfdc.java:9592)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.tWarn_6Process(a_corporate_td_to_sfdc.java:10081)
    at talend_main.a_corporate_td_to_sfdc_0_1.a_corporate_td_to_sfdc.runJobInTOS(a_corporate_td_to_sfdc.java:18737)
    at


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: HO to catch runtime exceptions in Talend

Add a subjob dedicated to catch exceptions, errors and warning:

Capture.PNG

 

Events are catched, you don't have to connect the subjob to anything.

In tLogCatcher, select the event type(s) to be catched.

Use tMap to arrange the output format as desired.

 Push the result to a tFileOutputDelimited.


TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: HO to catch runtime exceptions in Talend

Add a subjob dedicated to catch exceptions, errors and warning:

Capture.PNG

 

Events are catched, you don't have to connect the subjob to anything.

In tLogCatcher, select the event type(s) to be catched.

Use tMap to arrange the output format as desired.

 Push the result to a tFileOutputDelimited.


TRF
Five Stars

Re: HO to catch runtime exceptions in Talend

Thanks for explaining. but its not quite clear to me. Could you please elaborate more
One Star

Re: HO to catch runtime exceptions in Talend

In fact, if you know Java, the tLogCatch is like :

 

try {

 

   ... your code from your Talend components ...

 

catch(java.lang.Exception e) {

    ... flow of the error catched. For example, you tMap it to put it into a log file

}

 

Hope it helps you.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch