Skip to main content
Solved

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

  • Jan 8, 2025 5:40 AM UTC
  • 4 replies
  • 100 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.

View original

4 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • Answer
  • Jan 9, 2025 2:13 PM UTC

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


  • Author
  • Cadet | Tier 2
  • Jan 10, 2025 12:19 AM UTC

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
Forum|alt.badge.img+6
  • Automation Anywhere Team
  • Jan 10, 2025 1:28 AM UTC

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. 


  • Author
  • Cadet | Tier 2
  • Jan 10, 2025 1:51 AM UTC

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