I have created 1 argument with out direction and assigning the value to that argument in Exception block of the code so that if any exception occurs that argument will be assigned with some value and can be used after rethrowing of the exception to outside
Hi @Shreya_Rao1 , please look at this thread, where something similar was discussed:
It seems that you’re filling the variable in the “Catch” part, and therefore it should get filled, but nonetheless, changing that variable to some structured type like dictionary, or DT, might be worth a try.
There are 2 points to take care, I think.
First, if some exception is thrown (or re-thrown) in callee xaml, Out type argument is not assigned as a result, even if some value is assigned in callee xaml before then.
Second, if some exception is thrown in callee xaml, it’s immediately caught by try-catch activity in caller xaml when it exits from callee xaml. So in this case, WriteLine activity just after InvokeWorkFlowFile activity won’t run.
@Shreya_Rao1 According to your statement, when an exception occurs the argument was assigning with a value, correct but since you are re-throwing that exception it was returning an empty value
The argument returns the updated value or assigned value only when the workflow successfully processed. Otherwise, it returns a empty or last run value
In this case, instead of assigning value to the argument , after re-throw you can use exception.Message which gives the exception reason