Is there a way to stop a script execution before the end of the script? (like exit in some other script languages)
Best Regards,
Sasha
Best Answer
C
Customer Support
said
almost 6 years ago
Hi Sasha,
You can use a throw in Cloud Code to stop a script at a certain point. In your Cloud Code script if a certain condition isn't met you could use the following to stop the script at that point.
throw "Your Error Here";
Hope that helps, if you have any further questions just let me know.
You can use a throw in Cloud Code to stop a script at a certain point. In your Cloud Code script if a certain condition isn't met you could use the following to stop the script at that point.
throw "Your Error Here";
Hope that helps, if you have any further questions just let me know.
Thanks,
Liam
S
SashaMirkovic
said
almost 6 years ago
Thanks Liam, this is what I was looking for.
R
Rich Joslin
said
almost 6 years ago
Is there a way to throw without logging an error to Mongo?
SashaMirkovic
Hello,
Is there a way to stop a script execution before the end of the script? (like exit in some other script languages)
Best Regards,
Sasha
Hi Sasha,
You can use a throw in Cloud Code to stop a script at a certain point. In your Cloud Code script if a certain condition isn't met you could use the following to stop the script at that point.
Hope that helps, if you have any further questions just let me know.
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Sasha,
You can use a throw in Cloud Code to stop a script at a certain point. In your Cloud Code script if a certain condition isn't met you could use the following to stop the script at that point.
Hope that helps, if you have any further questions just let me know.
Thanks,
Liam
SashaMirkovic
Thanks Liam, this is what I was looking for.
Rich Joslin
Is there a way to throw without logging an error to Mongo?
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics