Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-22 03:54 PM
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
------------------------------
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
------------------------------
Answered! Go to Answer.
1 BEST ANSWER
Helpful Answers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-22 08:13 PM
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
------------------------------
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
------------------------------
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-22 08:13 PM
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
------------------------------
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
------------------------------
