Attached an example (TerminationTest calls ExceptionTest which throws a WorkflowTerminatedException).
(pretend WTE_Exception is a caught WorkflowTerminatedException)
WTE_Exception.message will show the Reason
WTE_Exception.innerException will let you access an exception passed in the Exception argument to the Terminate Workflow activity.
Please note that WorkflowTerminatedException can only be caught one (or more) levels up in the invoke chain.
As a sidenote:
In a setup like yours it would be a good practice to put the exception that caused the termination (the caught SelectorNotFoundException exception) as the Exception argument to TerminateWorkflow activity, to have it accessible upper in the call chain. Otherwise it’s an equivalent of swallowing the actual exception and throwing a new one, which is not recommended in general, as it makes debugging harder - the actual selector that was not found is never logged.
In a standard logging sequence there’s usually at least 5 elements found (window/browser, username, password, submit button, one element in a screen after logging to confirm it passed), any of them can fail and you’re not logging which of them did.
If you don’t want to pass it higher up for some reason, the message of it should at least be logged using LogMessage activity (level warning or higher, depending on your practices). That way you don’t need to run to see what happened, it’s already in the logs.
ExceptionTEst.xaml (8.9 KB)
TerminationTest.xaml (6.6 KB)