I noticed that Business Rule Exceptions thrown (using the throw business rule activity) in a Workflow that is invoked inside a try-catch activity cannot be caught as a OpenRPA.BusinessRuleException.
In my mind this must be a bug. If I throw it directly in the try-catch it is caught. When thrown in a subflow, it should propagate back to the calling flow (if not caught elsewhere), as if it had been thrown here.
I attached the example, but it is also very quick to reproduce from the description above.
If the exception was not cought, openrpa woudl crach and then it was a bug.
The problem is you need to “unwrap” it, by recursively checking InnerException til you find it
Update Workitem does this for you and make sure to set the correct errortype on the woritem
I do not see why OpenRPA will crash if the “Invoke OpenRPA” activity returns a OpenRPA.BusinessRuleException instead of a System.Exception when an OpenRPA.BusinessRuleException has been thrown inside of a sub-workflow.