diff --git a/docs/config.rst b/docs/config.rst index 77c8360..047e28d 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -35,7 +35,7 @@ Those configuration options are documented below: .. describe:: logger - The name of the logger used by Sentry. Default: ``''`` + The name of the logger used by Sentry. .. code-block:: javascript diff --git a/lib/client.js b/lib/client.js index 21f22be..40705b0 100644 --- a/lib/client.js +++ b/lib/client.js @@ -54,12 +54,11 @@ extend(Raven.prototype, { this.root = options.root || global.process.cwd(); this.transport = options.transport || transports[this.dsn.protocol]; this.sendTimeout = options.sendTimeout || 1; - this.release = options.release || global.process.env.SENTRY_RELEASE || ''; + this.release = options.release || global.process.env.SENTRY_RELEASE; this.environment = options.environment || global.process.env.SENTRY_ENVIRONMENT || - global.process.env.NODE_ENV || - ''; + global.process.env.NODE_ENV; // autoBreadcrumbs: true enables all, autoBreadcrumbs: false disables all // autoBreadcrumbs: { http: true } enables a single type @@ -68,7 +67,7 @@ extend(Raven.prototype, { this.maxBreadcrumbs = Math.max(0, Math.min(options.maxBreadcrumbs || 30, 100)); this.captureUnhandledRejections = options.captureUnhandledRejections; - this.loggerName = options.logger || ''; + this.loggerName = options.logger; this.dataCallback = options.dataCallback; this.shouldSendCallback = options.shouldSendCallback; this.sampleRate = typeof options.sampleRate === 'undefined' ? 1 : options.sampleRate; @@ -266,11 +265,14 @@ extend(Raven.prototype, { kwargs.timestamp = new Date().toISOString().split('.')[0]; kwargs.project = this.dsn.project_id; kwargs.platform = 'node'; + kwargs.release = this.release; - // Only include release information if it is set - if (this.release) { - kwargs.release = this.release; - } + // Cleanup empty properties before sending them to the server + Object.keys(kwargs).forEach(function(key) { + if (kwargs[key] == null || kwargs[key] === '') { + delete kwargs[key]; + } + }); if (this.dataCallback) { kwargs = this.dataCallback(kwargs);