WTH can't I respond to errors in an automation/script

continue_on_error was a nice addition recently. But it only lets you choose between two options:

  1. raise and stop
  2. suppress and continue

It would be great if there was some way to react to the error. Like:

  1. set the details of the error to a variable that is available after that step for use on templates, conditionals, etc
  2. run a set of actions on any error in the automation (like wrapping the entire set of actions in try-except)
  3. a try-except type action that can be used as a step. Allowing the author to choose whether that automation continues or not and do different error handling at different spots

I have a POC branch somewhere for this. The idea was to allow on_failure kinda action list on each sequence (which gets fed information about the exception).

This would also work UI-wise, as there is no need to wrap it in a try/catch block (as we already have sequences).

PS: Voted too of course :heart:

3 Likes

Could be a tangent: what if an error could be the trigger of another automation? It could be an event containing which automation/script the error originated.

This would be awesome! Whenever an automation raises an error, it sends an event that could be used in a trigger of another automation (eg. notification that some thing failed) !

That’s definitely an option. And if that is what we got I would certainly use it.

That being said my preference would be something that allows me to put the error handling logic in the same automation raising the error. That way everything about that automation is in one place instead of split between multiple.

1 Like