I’m having the following situation:
When I’m searching something in an application, I’m able to get “not found”. Now, if it’s not found, I would like to interrupt the workflow and not process any further. For this, I have everything in the Try/Catch (in this case, in the Try-Block). Now, I would like to use “Throw” (best would be a tailored exception) or at least a system exception. I’ve seen and read this members question:
Now, on a more general note: I cannot find the “throw” activity documentation. What belongs into the field “Exception”? If I try “exception” (same as in the catch-activity), it won’t accept it (it’s declared as “String” and cannot be converted into “Type”). What’s the trick here?
You need to give there an instance of System.Exception, or anything that inherits from it, f.e. new UiPath.Core.BusinessRuleException("Required data XYZ not found... bla bla bla...")
I have a “Throw” activity with the Exception defined:
new UiPath.Core.BusinessRuleException(“bla bla bla”)
and while executing it says “Throw executing” and right after “Throw faulted” where it does cancel the sequence… I do not have a “Create exception” defined before…
it seems that “throw” is supposed to fail… where the rest is working fine. It is now throwing a businessruleexception and directing into the right “catch”-block.