Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have this job in which two tables are there. I want to capture the failure if one of the tables have error because of schema of query etc. through the mail.
Please guide.
Thanks
Hello,
The job design looks like:
tDB--main--tMap--->Output
tDB--lookup
tLogCatcher--main--tJavaRow
|
onsubjobok
|
tSendmail
uncheck the option 'die on error' on all the component, so that the job will throw the exception once fails and die.
on tJavaRow:
globalMap.put("errorCode", input_row.message);
on the message body of tsendmail:
"the error message is: "+(String)globalMap.get("errorCode")
uncheck the option 'die on error' on all the components.
Hope it helps for your use case.
Best regards
Sabrina
Hi @Amit Yadav
Try using a tLogCatcher component on your job to capture the errors and redirect them to a tSendMail.
Hello,
The job design looks like:
tDB--main--tMap--->Output
tDB--lookup
tLogCatcher--main--tJavaRow
|
onsubjobok
|
tSendmail
uncheck the option 'die on error' on all the component, so that the job will throw the exception once fails and die.
on tJavaRow:
globalMap.put("errorCode", input_row.message);
on the message body of tsendmail:
"the error message is: "+(String)globalMap.get("errorCode")
uncheck the option 'die on error' on all the components.
Hope it helps for your use case.
Best regards
Sabrina
Hi Sabarina,
Thanks for your response. I tried your suggested method but I am getting error like this.
It is failing in mail component.
Inside the mail component:
I checked the code designer in which add() function causing the failure.
Please check and let and guide for the further steps.
Thanks,
Amit
Hello,
It seems that there is missing () in your email message body
"The exception is:"+((String)globalMap.get("errorCode"))
Feel free to let us know if it works.
Best regards
Sabrina
Hi Sabarina,
I have used this function inside the message box. Still, I am facing issue in tsend mail component. Given all the screenshots in the above comment also.
Please guide.
Thanks!
Hello,
Please try to use tlogcatcher --> tsendmail and the message body should be:
"The exception is:"+((String)globalMap.get("tLogCatcher_1_ERROR_MESSAGE"))
Best regards
Sabrina