aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/error_reporter.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 02:25:10 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 02:25:10 +0800
commite2a16f3f336c6787501c6a2366e7793a135009f8 (patch)
treea4ecb9d821cbb986a425136f3a2ead3ee4acfd85 /packages/instant/src/util/error_reporter.ts
parent70c99082496bbaed5b5ccc37bb259c0a9f02fab5 (diff)
downloaddexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.gz
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.bz2
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.lz
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.xz
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.tar.zst
dexon-sol-tools-e2a16f3f336c6787501c6a2366e7793a135009f8.zip
Use ROLLBAR_ENABLED constant, and change ROLLBAR_ENVIRONMENT to INSTANT_ENVIRONMENT
Diffstat (limited to 'packages/instant/src/util/error_reporter.ts')
-rw-r--r--packages/instant/src/util/error_reporter.ts13
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/instant/src/util/error_reporter.ts b/packages/instant/src/util/error_reporter.ts
index c5766b469..89c5b6bd3 100644
--- a/packages/instant/src/util/error_reporter.ts
+++ b/packages/instant/src/util/error_reporter.ts
@@ -1,24 +1,17 @@
import { logUtils } from '@0x/utils';
import * as _ from 'lodash';
-import { ROLLBAR_CLIENT_TOKEN, ROLLBAR_ENVIRONMENT } from '../constants';
+import { INSTANT_ENVIRONMENT, ROLLBAR_CLIENT_TOKEN, ROLLBAR_ENABLED } from '../constants';
// Import version of Rollbar designed for embedded components
// See https://docs.rollbar.com/docs/using-rollbarjs-inside-an-embedded-component
// tslint:disable-next-line:no-var-requires
const Rollbar = require('rollbar/dist/rollbar.noconflict.umd');
-const shouldAllowRollbar = () => {
- if (ROLLBAR_ENVIRONMENT === 'development') {
- return process.env.ROLLBAR_FORCE_DEVELOPMENT_REPORT ? true : false;
- }
- return true;
-};
-
let rollbar: any;
// Configures rollbar and sets up error catching
export const setupRollbar = (): any => {
- if (_.isUndefined(rollbar) && ROLLBAR_CLIENT_TOKEN && ROLLBAR_ENVIRONMENT && shouldAllowRollbar()) {
+ if (_.isUndefined(rollbar) && ROLLBAR_CLIENT_TOKEN && INSTANT_ENVIRONMENT && ROLLBAR_ENABLED) {
rollbar = new Rollbar({
accessToken: ROLLBAR_CLIENT_TOKEN,
captureUncaught: true,
@@ -27,7 +20,7 @@ export const setupRollbar = (): any => {
itemsPerMinute: 10,
maxItems: 500,
payload: {
- environment: ROLLBAR_ENVIRONMENT,
+ environment: INSTANT_ENVIRONMENT,
client: {
javascript: {
source_map_enabled: true,