Send uncaught exceptions to Rollbar

I want to ingrate with Rollbar for incident tracking.
Rollbar can handle uncaught exceptions and unhandled rejections with options: captureUncaught: true, captureUnhandledRejections: true,.
But it’s not working in the function.
It seems like netlify doesn’t allow setting custom process.on('unhandledRejection'). I tried even without rollbar, just directly calling process.on('unhandledRejection'), but it’s not working.

What IS working is handling errors with try-catch and sending errors to Rollbar in the catch clause and then rethrowing the error.

I don’t want wrapping each and every function in its own try-catch.

How can I setup unhandled exception handler for a function?

Functions run in AWS Lambda. It looks like rollbar has special requirement for Lambda based on this:

Are you following that workflow in your code?

1 Like

Yes it helped. Thank you, Luke