Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Keeping existing config values for includePaths, whitelistUrls, for compatibility.
const ravenConfig = assign({
environment,
includePaths,
whitelistUrls,
release: this.get(serviceReleaseProperty) || config.APP.version
}, ravenOptions);
Raven.config(dsn, ravenConfig);
} catch (e) {
console.warn('Error during `sentry` initialization: ' + e);
return;
}
Raven.install();
const { globalErrorCatching = true } = config.sentry;
if (globalErrorCatching === true) {
this.enableGlobalErrorCatching();
}
},
function FruumServer(options, cli_cmd, ready) {
logger.system('Starting Fruum');
options = options || {};
// start sentry
if (options.sentry && options.sentry.dsn) {
logger.system('Sentry is enabled');
Raven.config(options.sentry.dsn).install();
Raven.install(function() {
process.exit(1);
});
} else {
logger.system('Sentry is disabled');
}
logger.system('Creating build folder');
mkdirp.sync(BUILD_FOLDER);
// defaults
options.static_root = path.resolve(
__dirname + '/../' + (options.static_root || 'static')
);
options.static_prefix = options.static_prefix || '/static';
options.port = options.port || 3000;
options.storage_engine = options.storage_engine || 'base';
export function initializeCrashReporter(options) {
const { DSN, ravenConfig } = options
raven.config(production ? DSN : false, {
environment: process.env.NODE_ENV, // Should always be production
...ravenConfig,
})
if (production) {
raven.install()
}
}
function setupRaven() {
raven.config(noSentry ? false : DSN, {
environment: 'production',
autoBreadcrumbs: true,
release: pkg.version,
})
if (!noSentry) {
raven.install()
}
}
async function errorReporter() {
const trackingConfigFilePath = path.join('..', '..', 'tracking-config.json')
if (await fileExists(trackingConfigFilePath)) {
const trackingConfig = await readFile(trackingConfigFilePath)
const { sentryDSN, environment } = trackingConfig
raven.config(sentryDSN, {
environment,
autoBreadcrumbs: true,
release: pkg.version
})
raven.disableConsoleAlerts()
raven.install()
return raven
}
return null
}