UiPath HTTP Request - which is the correct exception type if I handle HTTP Request in Try Catch activity

Hi, Please help!

I am struggling to find an exception type that suits the HTTP Request activity. Tried all different exception but when the request actually throws UnAuthorised message its not jumping into exception block for some reason. Am I missing anything here? any example links for this?

Much appreciated
Thanks

Hi, welcome to the community!
I think the type would be HttpRequestException, did you try it?

Yes, just tried now but still same issue, its not jumping into exception block. I have put the screenshot here. Thanks!

you have the wrong type thereā€¦

I canā€™t find HttpRequestException when I browse for the exception type.

It would be on system.net.http namespace, but to be honest, do you really need t do that? Did you even get an exception coming from your endpoint that you cant just use generic Exception type to handle? Usually what you do is using an Switch case for the result code to see if anything goes wrong thereā€¦

1 Like

I did purposefully put wrong password in the Authorisation section, so the log message when I run project shows ā€˜message: unauthorisedā€™. I want to handle this if this is not actually an exception. I am trying to work around the exceptions for http Request.

the 401 is supposed to be a response code and not an exceptionā€¦

1 Like

Got it, thanks!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.