From ccabff5e4cefa64b63c0e6ae689f51c0eb5a1d4f Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Fri, 9 Jul 2021 14:31:54 +0300 Subject: [PATCH] Improve log Signed-off-by: Hung-Han (Henry) Chen --- src/common/sentry.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/sentry.ts b/src/common/sentry.ts index 653cc30bdb..68453b4406 100644 --- a/src/common/sentry.ts +++ b/src/common/sentry.ts @@ -21,7 +21,7 @@ import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations"; import * as Sentry from "@sentry/electron"; -import { sentryDsn, isProduction } from "./vars"; +import { sentryDsn, sentryDsnIsValid, isProduction } from "./vars"; import { UserStore } from "./user-store"; import logger from "../main/logger"; @@ -82,7 +82,12 @@ export function SentryInit() { environment: isProduction ? "production" : "development", }); - logger.info(`✔️ [SENTRY-INIT]: Sentry for ${processName} is initialized.`); + if (sentryDsnIsValid) { + logger.info(`✔️ [SENTRY-INIT]: Sentry for ${processName} is initialized.`); + } else { + logger.info(`⚠️ [SENTRY-INIT]: Sentry for ${processName} is initialized but cant transport exceptions because dsn is not valid`); + } + } catch (error) { logger.warn(`⚠️ [SENTRY-INIT]: Sentry.init() error: ${error?.message ?? error}.`); }