How to go to the restart a flowchart while having an exception?

Hey,

when i have an exception and i caught it with try-catch, how can i get out of the whole project and start over on flowchart?

Hi @orengolan,

I’ll suggest you to throw an exception in try and catch it in catch section and after try catch you can simply take flow decision with this condition —> exception.Message.Equals(“Error message”)
Now connect true part of flow decision to the 1st activity as you want it that way.

Prerequisites
To throw an exception, use Throw activity with following syntax.

new Exception("Error message")

In the ‘Catch’ activity you can choose the type of exception you want to catch e.g System.Exception.
And in Catch you use logMessage with exception.Message

I think you could have a boolean variable in main flow with default value=false, inside every step of your flow you will need to check this variable and if it is false you go back to start, but this might be nicer in a state machine, i guess…

greate thank you guys, i will try that.

i also finds that theres that state machine flow that can fix that.

1 Like