mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(core): Log crash causes to console when sentry is disabled (#6890)
This commit is contained in:
parent
dceff675ec
commit
6553d92c7c
|
@ -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');
|
||||||
|
|
|
@ -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',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue