Run time errors

Why do I get run time errors alert even though I have try catch?
I have rethrow in my catch.

I have a main flow in try catch. That calls a sub flow in try catch.
If error happens in sub flow, should I am doing rethrow in the catch.
Does it get caught in try catch in main?
Do I have to delete one try catch some where?

Thank you,

@A_Learner

If you rethrow in catch then the error pops up…if there is a try catch above it then it gets caught there but if in catch if any error occurs or if there is rethrow then the error bubbles out again

cheers

Thank you, bubble out meaning shows as an alert?

If I do not want that alert, but yet the main flow get to its catch section so it can take some action, what do I have to do?

Thank you so much

@A_Learner

bubble up means it would try to come out of the current sequence till it finds a catch which handles it or shows an alert

then you can actual remove the inner try catch or in catch of inner try catch have rethrow and on outer catch block do your steps and dont include rethrow

cheers

1 Like

Thank you, @Anil_G

I do not want the error alert show up.
I want the main workflow to handle the catch.
so if I delete the try catch for sub flow which is invoked, would that solve the purpose?

Thank you,

remove the rethrow that should satisfy your requirement

Thank you. But then how does the system exception in subflow propagate to main?

Should I not catch it? That is why I am asking if I have to remove try/catch for sub flow

Thank you,

is this how your code is?

image
image

Main Flow

Try
Invoke Sub Flow

Catch Exception do action

Sub Flow:
Try

Catch Exception retrhow

hi since you don’t want to propagate the exception remove the rethrow add a log message activity for info purpose

1 Like

I want to get the exception to main flow. Just do not want the alert because that would throw away the user.

Thank you,

Trying this. Removed Try catch for sub flow totally

if your intention is to just to end the flow you can use return activity

otherwise you can remove the try catch from the sub-flow but if you face any exceptions it will be propagated to the main flow s well as outside alert thing to handle that use another parent try catch

That’s why. You’re throwing another exception outside the Try block.

@A_Learner

In the main try catch block if you are not rethrowing then it would not show the pop up

Cheers