From 6553d92c7c128b117b6bdbd33182002f6cf24fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 9 Aug 2023 13:29:57 +0200 Subject: [PATCH] fix(core): Log crash causes to console when sentry is disabled (#6890) --- packages/cli/src/ErrorReporting.ts | 4 ++-- packages/cli/src/config/schema.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/ErrorReporting.ts b/packages/cli/src/ErrorReporting.ts index 0388be4fc0..e9059e71ba 100644 --- a/packages/cli/src/ErrorReporting.ts +++ b/packages/cli/src/ErrorReporting.ts @@ -7,7 +7,8 @@ let initialized = false; export const initErrorHandling = async () => { if (initialized) return; - if (!config.getEnv('diagnostics.enabled')) { + const dsn = config.getEnv('diagnostics.config.sentry.dsn'); + if (!config.getEnv('diagnostics.enabled') || !dsn) { initialized = true; return; } @@ -15,7 +16,6 @@ export const initErrorHandling = async () => { // Collect longer stacktraces Error.stackTraceLimit = 50; - const dsn = config.getEnv('diagnostics.config.sentry.dsn'); const { N8N_VERSION: release, ENVIRONMENT: environment } = process.env; const { init, captureException, addGlobalEventProcessor } = await import('@sentry/node'); diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index 685a09a4da..74e4ae67ef 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -1013,8 +1013,7 @@ export const schema = { dsn: { doc: 'Data source name for error tracking on Sentry', format: String, - default: - 'https://1f954e089a054b8e943ae4f4042b2bff@o1420875.ingest.sentry.io/4504016528408576', + default: '', env: 'N8N_SENTRY_DSN', }, },