In a stored function/procedure I want to handle the HTTP error code received from a HTTP:POST procedure. I tried with on exception resume and with try catch but both don't seem to be able to catch the error. What I'm trying to do is in a function I use a cursor to loop through records and post a json to a web service. However when I receive a HTTP error the cursor stops and all the remaining records are not processed. How can I achieve that the HTTP error code is caught and the cursor continues? asked 03 Mar '20, 10:04 Frank Vestjens Volker Barth |
Are you using v17.0.4 or above? If so, the following FAQ may be of help. At least the error message looks alike. I suspect you need to change the web client function to a web client procedure in order to get the HTTP Status, AFAIK functions do only return the response's body, not the full response. Note, that's just from my memory... answered 05 Mar '20, 08:29 Volker Barth Changing the web client function to a procedure solved the issue. Thanks Volker
(09 Mar '20, 04:10)
Frank Vestjens
Replies hidden
Glad to hear that - feel free to accept that answer then:)
(09 Mar '20, 06:48)
Volker Barth
|
Do you
Yes, I get the -983 error
And your exception handler code does not catch the -983 error?
Please show us some snippets of the code...
This is the HTTP:POST procedure
This is the procedure calling the HTTP:Post procedure
when we execute call usr.Test500() in I-SQL then we get the following error:
There was an error reading the results of the SQL statement. The displayed results may be incorrect or incomplete. HTTP request failed. Status code '500 Internal Server Error' SQLCODE=-983, ODBC 3 State="HY000" Line 1, column 1
Is there a particular call that does return the error? Is the error also returned if you directly call the web client function with the according data?