if you want to propogate the exception as is in a technical language,
You can surround the activity with Try Catch where you’re anticipating this error, inside Catch select Sysemt.Exception and use a Throw activity with exception as:
new BusinessRuleException(exception.Message) , that’ll give you a technical statement.
But if you want your Business exception to be easily understood by the Business you should simple check if path exists and inside if condition: use a throw with exception as
new BusinessRuleException(" File Path doesn’t exist")
Thanks for your reply, the technical statement is exactly what I meant but how can I do New BusinessRuleException(exception.Message) without surrounding the activity with try catch?
So in short can I say that, “You don’t want any exception to be marked as a System Exception?”
If at any place you’re getting a system exception, you would be changing its type to Business Exception.
IF you wanna do so, you would have to atleast use the try catch block to do so.
Coz if you wouldn’t be catching an exception how would you be converting it to a Business exception using
new BusinessRuleException(exception.Message)
Happy to help more in case you need any further explanation.
We can’t send and exception.message without sorrounding it with try catch activity, when we create exceptions in the workflow we use Throw activity and then create the exception we want, in this case a businessruleexception, Try catch activity handle the error and let us continue or stop the workflow, also provide the message that appears within the Try block, if you want a message like that you should surround it with try catch activity, or else create your own message