Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function initSentry () {
const pkg = require('../../package.json')
Sentry.init({
dsn: 'https://a24e24e8c74f496db5fce2d611e085ee@sentry.miscord.net/2',
maxBreadcrumbs: 0, // important, as it shows console messages
release: `miscord@${pkg.version}`
})
Sentry.configureScope(scope => {
scope.setTag('is_packaged', Boolean(process.pkg).toString().toLowerCase())
scope.setTag('platform', platform())
scope.setTag('version', pkg.version)
scope.setTag('node_version', process.version)
})
}
export function initSentry () {
const pkg = require('../package.json')
Sentry.init({
dsn: 'https://a24e24e8c74f496db5fce2d611e085ee@sentry.miscord.net/2',
maxBreadcrumbs: 0, // important, as it shows console messages
release: `miscord@${pkg.version}`
})
Sentry.configureScope(scope => {
scope.setTag('is_packaged', Boolean(process.pkg).toString().toLowerCase())
scope.setTag('platform', platform())
scope.setTag('version', pkg.version)
scope.setTag('node_version', process.version)
})
}
initialise() {
Sentry.init({
dsn: "https://710778be7bd847558250574eb19e52e9@sentry.io/1509685"
})
Sentry.configureScope(scope => {
scope.setUser({
id: this.userId
})
scope.setTags({
deviceId: this.deviceId,
sessionId: this.sessionId.toString()
})
})
}
constructor(log, config, api) {
this.config = config;
this.homebridge = api;
this.Service = api.hap.Service;
this.Characteristic = api.hap.Characteristic;
PlatformAccessory = api.platformAccessory;
this.uuid = api.hap.uuid;
if (config === undefined || config === null || config.app_url === undefined || config.app_url === null || config.app_id === undefined || config.app_id === null) {
log(`${platformName} Plugin is not Configured | Skipping...`);
return;
}
Sentry.init({ dsn: 'https://c126c2d965e84da8af105d80c5e92474@sentry.io/1878896', release: `${pluginName}@${pluginVersion}`, attachStacktrace: true });
Sentry.configureScope(function(scope) {
scope.setUser({ id: machineId });
scope.setTag("username", os.userInfo().username);
scope.setTag("node", process.version);
scope.setTag("version", pluginVersion);
scope.setTag("platform", os.platform());
scope.setTag("type", os.type());
scope.setTag("arch", os.arch());
scope.setTag("release", os.release());
});
this.Sentry = Sentry;
this.ok2Run = true;
this.direct_port = this.findDirectPort();
this.logConfig = this.getLogConfig();
this.logging = new Logging(this, this.config["name"], this.logConfig);
this.log = this.logging.getLogger();
this.log.info(`Homebridge Version: ${api.version}`);
async function run() {
const versionData = await getVersion();
Sentry.init({ dsn: config.sentryDsn, release: versionData.version });
Sentry.configureScope(scope => {
scope.setTag('process', 'subhub_messaging');
});
try {
const subhubUpdatesQueue = new SQSReceiver(
config.subhubServerMessaging.region,
[config.subhubServerMessaging.subhubUpdatesQueueUrl]
);
const profile = require(`${LIB_DIR}/profile/client`)(log, config, statsd);
const [db] = await Promise.all([
require(`${LIB_DIR}/db`)(config, log, Token).connect(
config[config.db.backend]
),
require(`${LIB_DIR}/senders/translator`)(
config.i18n.supportedLanguages,
if(e.message.includes('Maximum call stack')) {
debugData.badSerializaton = detectBinary(gameState);
} else {
debugData.game = gameState;
debugData.game.players = undefined;
debugData.messages = game.getPlainTextLog();
debugData.game.messages = undefined;
_.each(game.getPlayers(), player => {
debugData[player.name] = player.getState(player);
});
}
Sentry.configureScope((scope) => {
scope.setExtra('extra', debugData);
});
Sentry.captureException(e);
if(game) {
game.addMessage('A Server error has occured processing your game state, apologies. Your game may now be in an inconsistent state, or you may be able to continue. The error has been logged.');
}
}
onSocketEvent(callback, ...args) {
if(!this.user) {
return;
}
try {
callback(this, ...args);
} catch(err) {
logger.info(err);
Sentry.configureScope((scope) => {
scope.setExtra('extra', args);
});
Sentry.captureException(err);
}
}
function setSentryUser({ user }) {
Sentry.configureScope(scope => {
scope.setUser(getUserObject(user));
});
}
addUserFunction(setSentryUser);