Created
December 14, 2020 18:08
-
-
Save javichur/683fb4899cc830e4c39fb0454b2f5e7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sentry = require("@sentry/serverless"); | |
Sentry.AWSLambda.init({ | |
dsn: 'https://[email protected]/0', // cambiar por el DSN que te proporciona Sentry. | |
tracesSampleRate: 1.0, | |
}); | |
exports.handler = Sentry.AWSLambda.wrapHandler(async (event, context) => { | |
// Your handler code | |
// TODO | |
// ... | |
// Samples | |
console.log('Standard message log.'); | |
console.error('Standard message error.'); | |
Sentry.captureMessage('Sentry message :)'); | |
try { | |
// ... | |
} catch (e) { | |
Sentry.captureException(e); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment