Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Rollbar from 'rollbar';
// Track error by rollbar.com
if (location.host === 'preview.pro.ant.design') {
Rollbar.init({
accessToken: '033ca6d7c0eb4cc1831cf470c2649971',
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: 'production',
},
});
}
import Rollbar from 'rollbar';
// Track error by rollbar.com
if (location.host === 'preview.pro.ant.design') {
Rollbar.init({
accessToken: '033ca6d7c0eb4cc1831cf470c2649971',
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: 'production',
},
});
}
import Rollbar from 'rollbar';
// Track error by rollbar.com
if (location.host === 'preview.pro.ant.design') {
Rollbar.init({
accessToken: '033ca6d7c0eb4cc1831cf470c2649971',
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
environment: 'production',
},
});
}
let logInstance = null
if (isClient()) {
minilog.enable()
logInstance = minilog('client')
const existingErrorLogger = logInstance.error
logInstance.error = (err) => {
window.Rollbar.error(err)
existingErrorLogger(err)
}
} else {
let enableRollbar = false
if (process.env.NODE_ENV === 'production') {
enableRollbar = true
rollbar.init(process.env.ROLLBAR_ACCESS_TOKEN)
const options = {
exitOnUncaughtException: false
}
rollbar.handleUncaughtExceptions(process.env.ROLLBAR_ACCESS_TOKEN, options)
}
minilog.suggest.deny(/.*/, process.env.NODE_ENV === 'development' ? 'debug' : 'debug')
minilog.enable()
.pipe(minilog.backends.console.formatWithStack)
.pipe(minilog.backends.console)
logInstance = minilog('backend')
const existingErrorLogger = logInstance.error
logInstance.error = (err) => {
existingErrorLogger(err.stack ? err.stack : err)
var redisHostSplit = options.redis.split(':');
options.redisHostname = redisHostSplit[0];
options.redisPort = redisHostSplit[1];
options.redisOpts = {
auth_pass: options.redisPassword
};
this.redis = require('redis').createClient(
options.redisPort,
options.redisHostname,
options.redisOpts
);
this.redis.on('error', throwError.bind(null, 'Redis Connection Error'));
};
rollbar.init('34dfc593cf14456985c66ffc12c6acc4');
rollbar.reportMessage('heyyyy', 'warn');
var util = require('util');
var log = require('loglevel');
var ArgumentParser = require('argparse').ArgumentParser;
var rollbar = require('rollbar');
var moment = require('moment');
var BaseParser = require('./lib/baseparser.js');
var DBR = require('./lib/dbr.js');
var Redshift = require('./lib/redshift.js');
var cliUtils = require('./lib/cliutils.js');
rollbar.init(process.env.ROLLBAR_TOKEN, {environment: process.env.ROLLBAR_ENVIRONMENT});
var parser = new BaseParser({
version: '0.0.1',
addHelp: true,
description: "Imports a specific detailed billing report to the line_items table."
});
parser.addArgument(
['--force'], {
action: 'storeConst',
dest: 'force',
help: 'Ignore and overwrite an existing staged DBR.',
constant: true
}
);
function rollbar (server, options, next) {
if (process.env.ROLLBAR_ACCESS_TOKEN) {
const rollbar = require('rollbar')
rollbar.init(process.env.ROLLBAR_ACCESS_TOKEN, {
env: process.env.NODE_ENV
})
rollbar.handleUncaughtExceptionsAndRejections(process.env.POST_SERVER_ITEM_ACCESS_TOKEN, {
exitOnUncaughtException: true
})
server.on('log', (event, tags) => {
if (!tags.error) {
return
}
rollbar.reportMessage(event.data)
})
}
next()
async init() {
if (typeof this._rollbar !== `undefined`) {
return this;
}
const storage = await BrowserStorage.get(`options`);
if (storage.options && storage.options.allowRollbar && (await browser.permissions.contains({ origins: [`*://api.rollbar.com/*`] }))) {
this._rollbar = RollbarSdk.init(this._config);
window.Rollbar = this._rollbar;
this.error = this._rollbar.error.bind(this._rollbar);
this.warning = this._rollbar.warning.bind(this._rollbar);
}
return this;
}
/*******************************************************************************
Import month-to-date DBRs, overwriting the existing month-to-date.
*******************************************************************************/
var util = require('util')
var log = require('loglevel')
var rollbar = require('rollbar')
var moment = require('moment')
var BaseParser = require('./lib/baseparser.js')
var DBR = require('./lib/dbr.js')
var Redshift = require('./lib/redshift.js')
var cliUtils = require('./lib/cliutils.js')
rollbar.init(process.env.ROLLBAR_TOKEN, {environment: process.env.ROLLBAR_ENVIRONMENT})
rollbar.handleUncaughtExceptions(process.env.ROLLBAR_TOKEN,
{exitOnUncaughtException: true})
var parser = new BaseParser({
version: '0.0.1',
addHelp: true,
description: 'Imports month-to-date detailed billing reports'
})
parser.addArgument(
['--no-stage'], {
action: 'storeConst',
dest: 'no_stage',
help: 'Use an existing staged month-to-date DBR.',
constant: true
}
Joi.validate(options, schema, (err) => {
if (err) {
return next(err);
}
Rollbar.init(options.rollbar.accessToken, {
environment: options.env
});
Rollbar.handleUncaughtExceptionsAndRejections(options.rollbar.accessToken, {
exitOnUncaughtException: true
});
plugin.on('request-error', (request, err) => {
Rollbar.handleError(err, request);
});
return next();
});
};