Rethrow Activity

Hi, Can anyone tell where to use rethrow activity with an example?

Hi @Pavithra_Ragunathan

Rethrow can be used after catching the exception in Catch block after doing necessary actions.

For more details follow the below link -

Regards,
Karthik Byggari

Check this out :slight_smile:

2 Likes

“Throw” is simply used to throw the exception before performing any action but “Re-Throw” on the other end will throw the exception after performing all the necessary action like logging of error in log file etc.

On more difference which I encounter is that “Throw” will resets the stack trace and makes your top level catch utterly useless!

So if we want to know actually at which line in stack trace the error will occur, we will use “re-throw”.

Ex: Consider a case in which we have a “try-catch” block in Main and inside this block we are calling any sub sequence and in that sub sequence we are again putting try catch block. In this case it is always be recommended to use re-throw activity in last catch block.

Cheers :grinning:

2 Likes