Throw e rethrown

Hi team,
i need only a little specification about throw e rethrown, i’ve just read topic and documentation, but i need to have some tips to how can i use it in RE-framework, and the difference between this two activities.
Thank you

Hi @proto

Difference between Throw and ReThrow :-

1) Throw :- Throw activity is used when you want to throw error before the execution of the step.

2) Rethrow :- Rethrow is used when you want activities to occur before the exception is thrown.

Have a look through below thread :-

That is the best eg for Throw Activity

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

in situations that a Bot will inform about an exceptional situation (e.g a mandatory requirement is not met) with throwing an exception it can be realized

with try/catch it can be reacted on an exception and be controlled on how the Bot will handle that scenario

if a catched (try catch) and handled (e.g write out transaction report) exception is to forwarding (e.g to the caller of an invoke workflow) the rethrow activity allows to resend the exception again

1 Like

So, in case i have a try catch with process state inside…
And inside the process state i manage some specific exception ex. businessruleexc or myexception, i can manage it with rethrown and manage in the catch expression?
So is important only to distinguish the type of exception?
Thanks guys

Have a look on REF setStatus Part. based on the Exception Type it is forking on BusinessException or systemError

a try catch should ideally always catch most generic exception (System.Exception) and can additional handle more specifc more specific Excecptions and rethrowing as an more specific Exception

e.g. catch date Parser Exception and rethrow it as BusinessRule Exception, just for constructing an explorative example

1 Like

So in case of business exception i need to add the specific activity in a try catch with a re-thrown inside the catch and doin new business rules exception for handle inside the main try/catch who contains the process?