Skip to main content
Cadet | Tier 2
January 8, 2025
Solved

Priority of task stop commands in error handler (catch) and action commands in error handler (finaly)

  • January 8, 2025
  • 4 replies
  • 89 views

If I put another action command(For Ex: close excel, deleat file etc...) in error handring [Finaly] and stop taskbot command in error handling[catch], Which one takes precedence?

In my opinion stop task command would take precedence.

Best answer by Aaron.Gleason

Yes, Task Bot: Stop would take precedence as it is not throwing an error to stop the automation.

4 replies

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
January 9, 2025

Yes, Task Bot: Stop would take precedence as it is not throwing an error to stop the automation.

TKD-MAuthor
Cadet | Tier 2
January 10, 2025

thank you Mr.Aalon.

One more question.

The bot I am currently creating has the bot exit command in the error handling[catch], but should I put it in the error handring [Finaly].
I want to stop the bot when an error occurs.

Aaron.Gleason
Automation Anywhere Team
Automation Anywhere Team
January 10, 2025

That depends on the bot logic. Generally, I only use Finally to organize my code. Since the Finally always executes, it's the same as putting actions after the Try... Catch block. 

TKD-MAuthor
Cadet | Tier 2
January 10, 2025

Thank you for  the ideas. I’ll refer to them.