Hi All.
The organisation I'm working for have set up a basic flow template structure which essentially compresses of a top-level try / catch scope. The 'try' would contain all the main actions of the flow, with the 'catch' handling failure & timeouts, and translates the cause of the failure and notifies an administrator via email. This was primarily done because we had a number of flows that were faulting and we weren't aware of them.
However, I'm working on a number of new flows, while trying to adopt this established template structure, where some actions will legitimately fail, and decisions need to be executed based on these legitimate failures. The problem that I am having is that these legitimate fails are triggering the 'catch' error handling.
In essence, what I really want to do is have nested try/catches as you would in other, traditional programming languages / environments. I've tried this approach and it makes no difference - any failure eventually percolates down to the top-level 'catch' scope.
Does anyone have any design suggestions (other than split everything) or is it possible to cancel a failure some how so it doesn't cascade down?
Many thanks in advance
Mike
Hay Chriddle,
Thanks for the help and support. I've replicated exactly what you have done and I can confirm that it works as you have stated, and solves my problem.
It seems that by adding the 'finally' scope, on the internal try/catch, and setting its run after to include everything, it effectively mutes the failure and prevents it from filtering down to the external try/catch. Without the inclusion of this 'finally' scope, any internal failures progress on to the external catch.
In some ways this logic makes sense (I guess) but its also a little illogical. In other programming paradigms, a 'catch' statement would intercept an exception (or all exceptions) and potentially handle them, without them progressing outside of the catch statement.
Anyway, all sorted now - thank you for your help
There is nothing special in my flow.
Each Try scope's run after is set to ["is successfuel"], each Catch scope is set to ["has failed", "has timed out"]
and each Finally has checked all options.
If the last action of a scope fails, then the scope fails. Maybe your inner catch fails? Without a "Finally" this would cause the outer Catch to run.
Exactly like that...
How did you achieve it? 🙂
I have a top-level try/catch scope, and if I add another try/catch scope within the main (top-level) try scope, configured in exactly the same manner (i.e. the 'catch' is set to run on failure or timeout) any failure in the internal 'try' filters down to both 'catches'...
Something like this?
I always add a "Finally" so I only need to mess with runafter settings within these scopes.