Try Catch Exception Question

Hi,

I have a try catch for an invole workflow MainProcess.

MainProcess has two invoke workflows SubProcess1 and SubProcess2

In the workflows SubProcess1 and SubProcess2 I have enclosed in try catch.

If there is an exception in Sub Process1 or SubProcess2 I am catching it and sending it over in Invoke workflow argument to MainProcess.

Since Main Process has its own try catch, when an error happens in SubProcess1 or SubProcess2 it is not being detected. It is being caught and process continuing.

What do I have to do if SubProcess1 or SubProcess2 fails, Main Process has to detect that.

Shall I be using the sent exception argument from sub process to mainprocess in some way so I can detect the error?

Thank you,

Hi @A_Learner

So, whenever an exception is thrown it throws an error and the error is caught in the immediate catch, if you wanna propogate the error upwards you need to use a Rethrow Activity.

Wherever your first catch is inside that catch block use a rethrow activity.

1 Like

In catch I can log the exception and then rethrow, correct?

Thank you,

1 Like

Correct! :slight_smile:

Anything inside the catch, and before the Rethrow will be executed, anything after the Rethrow will not :+1:

BR,
Ignasi

Yes anything that you use before rethrow be it a Log, or some other activities. All of them would be executed

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.