Question

Exception Handling

  • 1 August 2023
  • 1 reply
  • 41 views

Badge +5

Whats the validity of initial TRY/ CATCH Block? Will it be in use even after the next TRY/CATCH Block?

 

TRY - 1

….

TRY - 2

 

CATCH - 2

 

ACTIONS 1 

 

CATCH - 1

 

Will actions 1 will be handled by TRY 1? I remember reading somewhere that the validity of first TRY ends when the next TRY comes.. I understand that the TRY 2 is only for actions within that block


1 reply

Badge

TRY - 1

….

TRY - 2

 

CATCH - 2

 

ACTIONS 1 

 

CATCH - 1

 

Will actions 1 will be handled by TRY 1?

Yes, TRY 1 will execute the bot actions that are within the nested scope of TRY 1, including TRY 2 bot actions and ACTIONS 1.  If TRY 2 block / bot actions throw an exception, it will be caught by CATCH 2, if this block does not re-throw the exception, it will also continue and invoke the ACTIONS 1, but if does re-throw the/a new exception, it will essentially skip over ACTIONS 1 block and go straight to CATCH 1 and do not collect 200$

 

Reply