CamoOriginal post
Rank 4: Virtual Machine
What is the correct way to throw error, and get a failed state in the cloud functions? I get 200, when there are actuall errors. And i want to know exactly when something fails. Node.
Summary
Developers want to know how to properly throw errors in Cloud Functions to ensure a failed state is returned. They are currently receiving a 200 status code even when there are errors. The correct way to throw an error in Node.js is by using `throw new Error("Error message");`. By not catching the error, the function will indeed fail.