cancel
Showing results for 
Search instead for 
Did you mean: 

Web API Services and Error 500

orjan.almen
Level 6
I'm trying out Web API Services for real now and I wonder how come an HTTP status code 500 throws an exception? My expectation was that I would get my status code and be able deal with it in my object using the service, or at least that I could set it on the service to throw or not.

Anyone have a workaround? 

For my use case, I want to try web calls and collect their status codes, so I'd rather want the exact response code than a exception.

------------------------------
Orjan Almen
Sweden
------------------------------
1 BEST ANSWER

Helpful Answers

ewilson
Staff
Staff
Hi @Orjan Almen,

This is by design believe it or not. I agree with you though that the expectation would be to simply receive the response status code. I've brought this up with product previously, but I don't know that it will ever be changed.

For now, the best solution is to simply wrap your Web API service calls in a Block stage and process the exception. You'll receive the code and any response string, but you'll likely need to do some minimal parsing of it.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

View answer in original post

1 REPLY 1

ewilson
Staff
Staff
Hi @Orjan Almen,

This is by design believe it or not. I agree with you though that the expectation would be to simply receive the response status code. I've brought this up with product previously, but I don't know that it will ever be changed.

For now, the best solution is to simply wrap your Web API service calls in a Block stage and process the exception. You'll receive the code and any response string, but you'll likely need to do some minimal parsing of it.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------