None
FI
Debugging Netlify Function Errors with Sentry
[]
HTTP Toolkit
function reportError(error) { console.warn(error); if (!sentryInitialized) return; if (typeof error === 'string') { Sentry.captureMessage(error); } else { Sentry.captureException(error); } } function catchErrors(handler) { return async function() { try { return await handler.call(this, ...arguments); } catch(e) { // This catches both sync errors & promise // rejections, because we 'await' on the handler reportError(e); throw e; } }; } // Use the wrapper on each of your handlers like so: exports.handler = catchErrors(function (event, context) { ... }); async function reportError(error) { console.warn(error); if (!sentryInitialized) return; if (typeof error === 'string') { Sentry.captureMessage(error); } else { Sentry.captureException(error); } await Sentry.flush(); }