Skip to content

Commit

Permalink
fix(core): Log crash causes to console when sentry is disabled (#6890)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 17, 2023
1 parent a4eb9b8 commit ff2d4ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/ErrorReporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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;
}

// 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');
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,7 @@ export const schema = {
dsn: {
doc: 'Data source name for error tracking on Sentry',
format: String,
default:
'https://[email protected]/4504016528408576',
default: '',
env: 'N8N_SENTRY_DSN',
},
},
Expand Down

0 comments on commit ff2d4ac

Please sign in to comment.