cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle HTTP error codes

fvestjens
Participant
1,751

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?

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

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...

fvestjens
Participant
0 Kudos

Changing the web client function to a procedure solved the issue. Thanks Volker

VolkerBarth
Contributor
0 Kudos

Glad to hear that - feel free to accept that answer then:)

Answers (0)