DauleDK
DauleDK

Reputation: 3443

Firebase/Google cloud functions - is it possible to hook into cloud functions error event?

Is it possible to hook into Firebase/google cloud functions uncaughtException event - something like process.on('uncaughtException')?

Background

Using error tracking tools like Raygun, Sentry, StackHunter etc. can improve the develop experience tremendously as you can centralize error handling, and don't wait for users to report when something is broken.

Most error handling tools executes code in a wrapped context, that works great for a try/catch pattern. But to handle uncaught exceptions, access to the Node global error handler is a must.

Possible workaround

A solid pattern for wrapping functions? I am experimenting with this (in Sentry and firebase functions), update will follow.

Upvotes: 1

Views: 1075

Answers (1)

Iñigo
Iñigo

Reputation: 2680

You cannot modify how Node.js handles errors, as Google CFs don't allow it [1].

You can check here how the execution environment handles errors.

Upvotes: 1

Related Questions