Scenario: I’m trying to use Try/Catch how I would expect to do so in essentially any other scripting language: Try a bit of code that is likely to throw a few errors, catch nothing because the reframework is going to handle them, and use the finally block to do cleanup. I can do something silly, like capture all types of errors, save the error to a variable, check whether my error variable is not null, and then do my cleanup outside of the Try/Catch and throw the error again after I’m done to get around this, but that’s absolutely not how I would expect to have to use this.
Steps to reproduce: Create a Try Catch activity, Throw an error in the Try portion and Log Message in the Finally block. The message will not be logged.
Current Behavior: The Finally block is not being executed
Expected Behavior: Even in the case of an uncaught error, the Finally block should execute.
Studio/Robot/Orchestrator Version: 2018.4.4 (All three)
OS Version: Windows 10
Others if Relevant: (workflow, logs, .net version, service pack, etc):
Example of expected behavior: Test_FinallyExpected.xaml (5.8 KB)
Example of current behavior / workaround: Test_FinallyCurrent.xaml (9.2 KB)
The docs explicitly state that the finally block will be performed regardless of an error: Try Catch
Please see below post for a good summary of the issue: