#Continue on Error clarification

1 messages · Page 1 of 1 (latest)

iron sluice
#

My apologies for posting this to here and Reddit, but I didn’t get a response on Reddit so I’m trying here:

I have a question about the “Continue on Error” option and how the logic executes. Let me explain it with two different scripts:

Script one: each light is turned on one at a time, with “continue on error” applied to each one.

Script two: a single entry for an entire area is set to turn on all the lights.

Can I apply “continue on error” to script 2? And if so, does this apply to each light, so that if one light fails, the others will continue to be controlled, or does it just fail the entire entry and move on to whatever is next in the script?

One more question: is there any way to put a “continue on error” command on…well…just everything? It actually seems strange to me that the default behavior is to fail on errors. I would assume it would be the other way around. I have absolutely no scripts or automtions that I would want to stop mid-way through just because a device didn’t/couldn’t respond or something. That seems crazy to me. It seems even crazier that the only way around this is to add a line of YAML code to every single instruction in a script or automation. Why does it work this way?

plucky pecan
#

You can apply continue on error to script 2, and it will likely run the action on all lights in parallel if the integration supports it. It's also dependent on the integration whether or not it will run the command on all lights if one fails. TLDR: It depends on your integration

#

continue on error is not default because it didn't exist when automations were originally built

#

and it would be a breaking change if it was just added in willy nilly

#

to apply it to all actions, your only option is copy/paste

iron sluice
#

I can imagine scenarios where I’d want an automation to fail if a device doesn’t respond or something goes wrong. But to essentially make that the only option is surprising to me. The solution is truly an afterthought, and one that’s difficult to implement.

plucky pecan
#

You're welcome to put in a PR to add it to the UI

iron sluice
#

I definitely will. Especially since it’s not easy to know how to implement it on different calls…

plucky pecan
#

This feature was added by a volunteer, before the current UI, and well after automations were established.

#

just like any open source project, there's likely room for improvement somewhere for every feature

iron sluice
#

where do I submit the PR

plucky pecan
#

PR means that you will be writing the code and adding it to HA through github