In my Google Apps Script, when I catch an error, I email a log of the error then I want to exit the script immediately.
I cannot find a command to immediately terminate the script (the equivalent of PHP's exit(). Please can someone tell me how to do this?
Thanks in advance Alec
Return only works if you have a single function without depth. What you actually want is to throw an exception, and catch it (or not) in your top level function. As in throw new Error("ouch")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With