Throw more than one exception?

Hi, how do I throw more than one exception in a workflow? I want to catch both exceptions in a higher level workflow. So lets say a workflow produces Exception1 and Exception2 or either, I want to be able to capture these. Currently I am facing a problem that when the first exception is thrown, the execution flow stops and cannot capture the second exception.

You have to use try/catch blocks in order to handle these kind of scenarios.

Once the Exception1 occurs, handle it in the first try/catch block. In the catch block you can store the exception details into variable. And proceed with the next activities.

Similarly for Exception2.

You can use these variables in the higher workflow.

Regards,
Karthik Byggari

1 Like

How do I handle both exceptions within one Try/Catch block? I am using the REFramework so I need to do this to handle exceptions from the Process.xaml file.

you can have multiple catches in the same try, to catch any number of specific errors

image

In my case I am trying to catch two BusinessExceptions, and I want to make sure that if one gets thrown first within the same workflow, the other one is thrown as well

At any time, the catch block catches only one exception.
You can’t catch two exceptions in a single catch block.

You have to re-arrange your workflow activities if you want to catch both exceptions like below

Try
Exception1 Occurs
Catch
Exception1 Handled

Try
Exception2 Occurs
Catch
Exception2 Handled

That’s what I am trying to figure out because doing so will mess up my REFramework workflow… I am supposed to handle two exceptions from within the Process.xaml file, these exceptions are to be handled in Main.xaml