Skip to main content
Answer

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

  • January 8, 2025
  • 4 replies
  • 46 views

Forum|alt.badge.img+3

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
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • January 9, 2025

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


Forum|alt.badge.img+3
  • Author
  • 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
Forum|alt.badge.img+14
  • 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. 


Forum|alt.badge.img+3
  • Author
  • Cadet | Tier 2
  • January 10, 2025

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