Explain what happens to calling script when called script has errors (#14059)

This commit is contained in:
Phil Bruckner 2020-07-22 08:55:31 -05:00 committed by Franck Nijhof
parent 2e2a4cca8a
commit 9199debf28
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -203,14 +203,17 @@ script:
### Waiting for Script to Complete
When calling a script "directly" (e.g., `script.NAME`) the calling script will wait for the called script to finish.
If any errors occur that cause the called script to abort, the calling script will be aborted as well.
When calling a script (or multiple scripts) via the `script.turn_on` service the calling script does _not_ wait. It starts the scripts, in the order listed, and continues as soon as the last script is started.
Any errors that occur in the called scripts that cause them to abort will _not_ affect the calling script.
<p class='img'>
<img src='/images/integrations/script/script_wait.jpg'>
</p>
Following is an example of the calling script not waiting. It performs some other operations while the called script runs "in the background." Then it later waits for the called script to complete via a `wait_template`.
This technique can also be used for the calling script to wait for the called script, but _not_ be aborted if the called script aborts due to errors.
{% raw %}
```yaml