Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setContext(isBackground, context) {
console.log('setting context:', isBackground, context);
cachedContext = context;
GATracker.set('userId', context.reportingUUID);
GATracker.set('dimension1', context.tags.hasFullVersion ? 'full' : 'free');
GATracker.set('dimension2', context.tags.isDeveloper ? 'yes' : 'no');
GATracker.set('dimension5', context.tags.licenseState);
Raven.setUserContext(context.user);
context.tags.isBackground = isBackground; // eslint-disable-line no-param-reassign
Raven.setTagsContext(context.tags);
}
function setContext(isBackground, context) {
console.log('setting context:', isBackground, context);
cachedContext = context;
GATracker.set('userId', context.reportingUUID);
GATracker.set('dimension1', context.tags.hasFullVersion ? 'full' : 'free');
GATracker.set('dimension2', context.tags.isDeveloper ? 'yes' : 'no');
Raven.setUserContext(context.user);
context.tags.isBackground = isBackground; // eslint-disable-line no-param-reassign
Raven.setTagsContext(context.tags);
}
import Raven from 'raven-js';
if (process.env.ENABLE_SENTRY) {
Raven.config('https://f7710348f19c4a0f8f8cd83ea0aa343f@sentry.io/1259561', {
release: process.env.GIT_REVISION, // use git revision as release? {{process.env.GIT_REVISION}}
environment: 'development-test',
tags: {
module: process.env.NAME,
},
}).install();
if (game) {
Raven.setTagsContext({
shard: game.shardID,
});
Raven.setUserContext({
id: game.selfPlayerState.characterID,
});
}
setTimeout(() => {
Raven.setTagsContext({
shard: game.shardID,
});
Raven.setUserContext({
id: game.selfPlayerState.characterID,
});
}, 1000);
}
try {
throwsError();
} catch(e) {
RavenJS.captureException(e);
RavenJS.captureException(e, {tags: { key: "value" }});
}
RavenJS.context(throwsError);
RavenJS.context({tags: { key: "value" }}, throwsError);
RavenJS.context({extra: {planet: {name: 'Earth'}}}, throwsError);
setTimeout(RavenJS.wrap(throwsError), 1000);
RavenJS.wrap({logger: "my.module"}, throwsError)();
RavenJS.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)();
RavenJS.setUserContext({
email: 'matt@example.com',
id: '123'
});
RavenJS.captureMessage('Broken!');
RavenJS.captureMessage('Broken!', {tags: { key: "value" }});
RavenJS.showReportDialog({
eventId: 0815,
dsn:'1337asdf',
user: {
name: 'DefenitelyTyped',
email: 'df@ts.ms'
}
});
function setUserInfo(info) {
if (info) {
Raven.setUserContext(info);
} else {
Raven.setUserContext();
}
}
loadRavenData: function() {
let profile = context.profile;
let userContext = {
id: profile.get("user"),
email: profile.get("email"),
username: profile.get("username")
};
if (context.hasEmulatedSession()) {
userContext.emulated = true;
userContext.emulator = context.getEmulator();
}
Raven.setUserContext(userContext);
Raven.setTagsContext(window.SENTRY_TAGS);
},
.then(res => {
this.update({ scitran: res.body }, { persist: true })
Raven.setUserContext({
email: user.profile.email,
id: user.profile._id,
})
})
.catch(err => {
export const stopTrackingUser = () => {
if (window.app.env === 'production') Raven.setUserContext();
};
signinError: message,
})
}
return
}
this.update(
{
token: user.token,
profile: user.profile,
provider: options.provider,
},
{ persist: true },
)
Raven.setUserContext({
email: user.profile.email,
id: user.profile._id,
})
crn
.verifyUser()
.then(res => {
if (!res.body._id) {
this.clearAuth()
let message =
'We are currently experiencing issues. Please try again later.'
if (!transition) {
notifications.createAlert({ type: 'Error', message: message })
} else {
this.update({
loading: false,
export const setupUser = userInfo => {
Raven.setUserContext(userInfo);
};