Comparing version 0.5.1 to 0.5.2
@@ -10,5 +10,3 @@ var parsers = require('./parsers'); | ||
var raw = require('raw-stacktrace'); | ||
var traces = raw({rawCallSites: true}); | ||
traces.setMaxListeners(100); | ||
traces.on("trace", function(err, callsites) {err.structuredStackTrace = callsites;}); | ||
var traces = null; | ||
@@ -30,2 +28,15 @@ module.exports.version = require('../package.json').version; | ||
var tracesOpts = { rawCallSites : true }; | ||
if ('function' == typeof options.stackFunction) | ||
tracesOpts.formatter = options.stackFunction; | ||
// Ensures traces is only defined once | ||
if (!traces) { | ||
traces = traces || raw(tracesOpts); | ||
traces.setMaxListeners(100); | ||
traces.on("trace", function(err, callsites) { | ||
err.structuredStackTrace = callsites; | ||
}); | ||
} | ||
this.raw_dsn = dsn; | ||
@@ -86,3 +97,14 @@ this.dsn = utils.parseDSN(dsn); | ||
var self = this; | ||
zlib.deflate(JSON.stringify(kwargs), function(err, buff) { | ||
// stringify, but don't choke on circular references, see: http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json | ||
var cache = []; | ||
var skwargs = JSON.stringify(kwargs, function(k, v) { | ||
if (typeof v === 'object' && v !== null) { | ||
if (cache.indexOf(v) !== -1) return; | ||
cache.push(v); | ||
} | ||
return v; | ||
}); | ||
zlib.deflate(skwargs, function(err, buff) { | ||
var message = buff.toString('base64'), | ||
@@ -89,0 +111,0 @@ timestamp = new Date().getTime(), |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["raven", "sentry", "python"], | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"repository": "git://github.com/mattrobenolt/raven-node.git", | ||
@@ -8,0 +8,0 @@ "author": "Matt Robenolt <matt@ydekproductions.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23878
458