Likely an easy question for somebody in the know...
I was reading the documentation for Firebase Cloud Functions and GCP Cloud Functions and I noticed that there is a difference in the recommended approach for handling errors. This surprised me because my understanding is that Firebase Cloud Functions are very closely related to GCP Cloud Functions.
In the Firebase documentation on error reporting it indicates that an error may be thrown to get it into StackDriver, as follows:
throw new Error('Fail!');
Meanwhile, the GCP Cloud Function documentation on error reporting states that uncaught exceptions force a cold start on a future invocation. Instead, the following is suggested:
console.error(new Error('Fail!'));
Does throwing the Error directly also cause a cold start on Firebase Cloud Functions? On Firebase, does sending the error to the console avoid this problem?
Thanks.