fix(core): Log crash causes to console when sentry is disabled (#6890)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-08-09 13:29:57 +02:00 committed by GitHub
parent dceff675ec
commit 6553d92c7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -7,7 +7,8 @@ let initialized = false;
export const initErrorHandling = async () => { export const initErrorHandling = async () => {
if (initialized) return; if (initialized) return;
if (!config.getEnv('diagnostics.enabled')) { const dsn = config.getEnv('diagnostics.config.sentry.dsn');
if (!config.getEnv('diagnostics.enabled') || !dsn) {
initialized = true; initialized = true;
return; return;
} }
@ -15,7 +16,6 @@ export const initErrorHandling = async () => {
// Collect longer stacktraces // Collect longer stacktraces
Error.stackTraceLimit = 50; Error.stackTraceLimit = 50;
const dsn = config.getEnv('diagnostics.config.sentry.dsn');
const { N8N_VERSION: release, ENVIRONMENT: environment } = process.env; const { N8N_VERSION: release, ENVIRONMENT: environment } = process.env;
const { init, captureException, addGlobalEventProcessor } = await import('@sentry/node'); const { init, captureException, addGlobalEventProcessor } = await import('@sentry/node');

View file

@ -1013,8 +1013,7 @@ export const schema = {
dsn: { dsn: {
doc: 'Data source name for error tracking on Sentry', doc: 'Data source name for error tracking on Sentry',
format: String, format: String,
default: default: '',
'https://1f954e089a054b8e943ae4f4042b2bff@o1420875.ingest.sentry.io/4504016528408576',
env: 'N8N_SENTRY_DSN', env: 'N8N_SENTRY_DSN',
}, },
}, },