Skip to main content
Announcements
Qlik Connect 2025! Where innovative solutions turn your data visions into reality: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
patrickkahle
Partner - Contributor III

Response SQL errors in ESB API

Hi,

i created a Rest-Call for adding data into a database. 

patrickkahle_0-1738063370795.png

My problem is that I don't realize when the SQL command encounters an error. This can be, for example, when fields are missing. In this case, I still send back a 200. How can I send the SQL error as a response body and a corresponding status code?

Best Regards

Patrick

Labels (3)
7 Replies
Dave_Simo
Creator

Hello @patrickkahle ,  

In your web services add this and you can also check the die on error in your tDBOutput.

Dave_Simo_0-1738075538677.png

 

Example during a ko connection the web service will see this again :

Dave_Simo_1-1738075684912.png

 

Best Regards

patrickkahle
Partner - Contributor III
Author

@Dave_Simo,

actually, thats not working for me.

patrickkahle_0-1738127387229.png

 

It seems that the log catcher is not triggered. When I send a request with postman, I get a 200 back in response to my request.

patrickkahle_1-1738127528843.png

 

But in Talend i get an error

patrickkahle_2-1738127574436.png

Best Regards

Dave_Simo
Creator

Hello @patrickkahle ,

 

Strange, did you check die on error in the tDBOutput component ?

Dave_Simo_0-1738139563920.png

 

Best Regards

patrickkahle
Partner - Contributor III
Author

hey @Dave_Simo ,

even with this checked checkbox, i can't get an error as response

patrickkahle_0-1740820151994.png

patrickkahle_1-1740820176545.png

Best regards

Dave_Simo
Creator

Hello @patrickkahle 

Hmm weird you configured your tRESTResponse like below.

Dave_Simo_0-1740847314234.png

Best Regards

patrickkahle
Partner - Contributor III
Author

It doesn't work with the setting either. For whatever reason, it continues with the row settings even though an error occurs. What would exception handling look like for routes?

Greetings

Dave_Simo
Creator

@patrickkahle 

 

For routes you can use the cErrorHandler and cOneException components to catch errors on your web services.

https://help.qlik.com/talend/fr-FR/mediation-components/8.0/mediation-logs-and-errors/cerrorhandler

Otherwise for your web services developed with tRESTRequest, I think you need to make a small modification to the design of your job as below to catch the exception during the error in tDBOUput.

Dave_Simo_0-1740923795020.png

Best Regards