Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
store.setIsInstalledGlobally(!!config.config.isInstalledGlobally);
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)
}