sql - How to get an errored message in Talend in order to send it by email? -
does possible know how errored message in talend?
i have tmssqlinput
==> tmssqloutput
. (see schema below).
if error thrown, i'd in mail body, , send it, instead of sendind message default.
i found :
globalmap.put("errorcode", input_row.message);
"the message is: "+(string)globalmap.get("errorcode")
but dont know, place first line. somewhere inside tmssqloutput
. where?
thank y'all in advance.
most talend components including tmysqloutput has error messages (after) available once component has failed or succeeded. can access value in these variables post component in next component tmysqloutput --->(oncomponentok)---->tjava ...in tjava can see there in tmysqloutput component using below expression - system.out.println((string)globalmap.get("tmysqloutput_1_error_message"));
you can store error message in global variable , use global variable in tsendemail component. assign value global variable use globalmap.out("variablename",value); fetch value (string)globalmap.get("variablename")
another way add tlogcatcher in application , enable die on error option in components. happen when exception raised tlogcatcher catch message , code , can connect tlogcatcher other components fetch error code , use in next components tsendemail sending email
Comments
Post a Comment