From e44cc8dbc2d5773329e4b7af7138493ae4be827d Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Wed, 13 Jan 2021 00:40:17 +0800 Subject: [PATCH] chore: ignore enterprise events --- src/analytics.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/analytics.ts b/src/analytics.ts index 17b1698..9309680 100644 --- a/src/analytics.ts +++ b/src/analytics.ts @@ -1,6 +1,7 @@ import * as Sentry from '@sentry/browser' import { Middleware } from 'driver/connect.js' import { IN_PRODUCTION_MODE, VERSION } from 'env' +import { platform } from 'platforms' const PUBLIC_KEY = 'd22ec5c9cc874539a51c78388c12e3b0' const PROJECT_ID = '1406497' @@ -54,10 +55,6 @@ const sentryOptions: Sentry.BrowserOptions = { } Sentry.init(sentryOptions) -export function raiseError(error: Error, extra?: any) { - return reportError(error, extra) -} - export const withErrorLog: Middleware = function withErrorLog(method, args) { return [ async function (...args: any[]) { @@ -71,13 +68,14 @@ export const withErrorLog: Middleware = function withErrorLog(method, args) { ] } -function reportError( +export function raiseError( error: Error, extra?: { [key: string]: any }, ) { - if (!IN_PRODUCTION_MODE) { + if (!IN_PRODUCTION_MODE || platform.isEnterprise()) { + // ignore errors from enterprise to get less noise on Sentry console.error(error) console.error('Extra:\n', extra) return