Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 谷歌应用脚本退出命令是什么_Google Apps Script - Fatal编程技术网

Google apps script 谷歌应用脚本退出命令是什么

Google apps script 谷歌应用脚本退出命令是什么,google-apps-script,Google Apps Script,在我的谷歌应用程序脚本中,当我发现错误时,我会通过电子邮件发送错误日志,然后我想立即退出脚本 我找不到立即终止脚本的命令(相当于PHP的exit()。有人能告诉我怎么做吗 提前谢谢 Alec仅当您有一个没有深度的函数时,返回才起作用。 实际上,您想要的是抛出一个异常,并在顶级函数中捕获它(或不捕获)。如抛出新错误(“哎哟”)中所述,如果您想完成运行函数,请使用 return; 回报是…:-)谢谢Zig。这就是我需要的

在我的谷歌应用程序脚本中,当我发现错误时,我会通过电子邮件发送错误日志,然后我想立即退出脚本

我找不到立即终止脚本的命令(相当于PHP的exit()。有人能告诉我怎么做吗

提前谢谢
Alec

仅当您有一个没有深度的函数时,返回才起作用。
实际上,您想要的是抛出一个异常,并在顶级函数中捕获它(或不捕获)。如抛出新错误(“哎哟”)

中所述,如果您想完成运行函数,请使用

 return;

回报是…:-)谢谢Zig。这就是我需要的