Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function startSentry(config) {
const captureErrors = isErrorCaptureEnabled(config);
const isDevelopmentEnvironment = config.environment !== 'production';
Sentry.init({
...config.sentry,
integrations: [new Ember()],
release: config.APP.version.match(versionRegExp)[0],
beforeSend(event, hint) {
const error = hint.originalException;
// ignore aborted route transitions from the Ember.js router
if (error && error.name === 'TransitionAborted') {
return null;
}
//print everything to the console when not in production
if (isDevelopmentEnvironment && error) {
console.error(error);
}
if (!captureErrors) {
return null;
}