Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function angularModule(angular) {
const prevCallback = Raven._globalOptions.dataCallback;
angularPlugin(Raven, angular);
// Hack: Ensure that both our data callback and the one provided by
// the Angular plugin are run when submitting errors.
//
// The Angular plugin replaces any previously installed
// data callback with its own which does not in turn call the
// previously registered callback that we registered when calling
// Raven.config().
//
// See https://github.com/getsentry/raven-js/issues/522
const angularCallback = Raven._globalOptions.dataCallback;
Raven.setDataCallback(function(data) {
return angularCallback(prevCallback(data));
});
return angular.module('ngRaven');
}
setDataCallback(callback) {
Raven.setDataCallback(callback);
}
function attachSentry(ENV) {
if (ENV.SENTRY_DSN) {
Raven.config(ENV.SENTRY_DSN).install();
Raven.setDataCallback(function(data, original) {
_normalizeData(data);
original && original(data);
});
}
}