Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Amit4
Contributor III
Contributor III

Capture Error in DB through mail

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.

0695b00000kWHasAAG.png

Please guide.

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable

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

View solution in original post

6 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Amit Yadav​ 

 

Try using a tLogCatcher component on your job to capture the errors and redirect them to a tSendMail.

Anonymous
Not applicable

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

Amit4
Contributor III
Contributor III
Author

Hi Sabarina,

 

Thanks for your response. I tried your suggested method but I am getting error like this.

0695b00000kWPJBAA4.png 

It is failing in mail component.

 

0695b00000kWPJVAA4.png 

Inside the mail component:

 

0695b00000kWPJuAAO.png 

 

I checked the code designer in which add() function causing the failure.

 

0695b00000kWPK4AAO.png 

 

Please check and let and guide for the further steps.

 

Thanks,

Amit

Anonymous
Not applicable

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

 

Amit4
Contributor III
Contributor III
Author

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.0695b00000kWtxVAAS.png 

Please guide.

 

Thanks!

Anonymous
Not applicable

Hello,

Please try to use tlogcatcher --> tsendmail and the message body should be:

"The exception is:"+((String)globalMap.get("tLogCatcher_1_ERROR_MESSAGE"))

 

0695b00000kWuU0AAK.pngBest regards

Sabrina