Skip to content

Instantly share code, notes, and snippets.

@taleschaves
Created June 12, 2024 20:08
Show Gist options
  • Save taleschaves/aa6f3b569856577cb9428482c5a98e2d to your computer and use it in GitHub Desktop.
Save taleschaves/aa6f3b569856577cb9428482c5a98e2d to your computer and use it in GitHub Desktop.
exports
const Sentry = require("@sentry/node");
const { nodeProfilingIntegration } = require("@sentry/profiling-node");
Sentry.init({
dsn: "",
integrations: [
nodeProfilingIntegration(),
],
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
});
exports.handlerFn = async (event, context) => {
let error = event?.error
if (error) {
Sentry.captureException(JSON.stringify(error));
}
return {
error: error
};
};
exports.handler = Sentry.wrapHandler(handlerFn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment