Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Vue from 'vue'
import * as Sentry from '@sentry/browser'
import * as Integrations from '@sentry/integrations'
if (__ENV.SENTRY_CONFIG) {
Sentry.init({
dsn: __ENV.SENTRY_CONFIG,
integrations: [
new Integrations.Vue({ Vue, logErrors: true }),
new Integrations.ExtraErrorData(),
],
release: __ENV.GIT_SHA1,
ignoreErrors: [
'ResizeObserver loop limit exceeded', // Chrome
'ResizeObserver loop completed with undelivered notifications', // Firefox
],
})
}
const Sentry = require('@sentry/node')
const sentryStream = require('bunyan-sentry-stream')
const Integrations = require('@sentry/integrations')
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
release: process.env.HEROKU_SLUG_COMMIT,
integrations: [
new Integrations.Transaction(),
new Integrations.Debug(),
new Integrations.ExtraErrorData()
]
})
module.exports = app => {
app.log.debug('Errors will be reported to Sentry')
app.log.target.addStream(sentryStream(Sentry, 'error'))
const router = app.route('/')
router.get('/boom', req => {
const err = new Error('Boom')
if (req.query.async) {
app.log.error(err)
return Promise.reject(err)
}
app.log.error(err)
throw err
let dashboard = null;
if (program.live) {
store.setUseLiveDashboard(true);
dashboard = new Dashboard();
dashboard.start();
}
const config = new Config();
Sentry.init({
dsn: 'https://2d4461f632f64ecc99e24c7d88dc1cea@sentry.io/1402474',
release: `foxy-proxy@${version}`,
attachStacktrace: true,
integrations: [
new Integrations.Dedupe(),
new Integrations.ExtraErrorData(),
new Integrations.Transaction(),
],
});
process.on('unhandledRejection', (err) => {
eventBus.publish('log/error', `Error: ${err.message}`);
});
process.on('uncaughtException', (err) => {
eventBus.publish('log/error', `Error: ${err.message}`);
});
store.setLogLevel(config.logLevel || 'info');
store.setLogDir(config.logDir);
if (config.logToFile) {
logger.enableFileLogging();
}