Comparing version 0.2.6 to 0.2.8
@@ -15,2 +15,3 @@ var http = require('http'); | ||
accessToken: null, | ||
codeVersion: null, | ||
host: os.hostname(), | ||
@@ -194,2 +195,7 @@ environment: 'development', | ||
notifier: SETTINGS.notifier}; | ||
if (SETTINGS.codeVersion) { | ||
data.code_version = SETTINGS.codeVersion; | ||
} | ||
var props = Object.getOwnPropertyNames(extra); | ||
@@ -255,13 +261,12 @@ props.forEach(function(name) { | ||
method: req.method}; | ||
if (req.method == 'POST') { | ||
var postParams = {}; | ||
if (req.body) { | ||
if (typeof req.body === 'object') { | ||
for (var k in req.body) { | ||
postParams[k] = req.body[k]; | ||
} | ||
data.POST = scrubRequestParams(postParams); | ||
} else { | ||
data.body = req.body; | ||
if (req.body) { | ||
var bodyParams = {}; | ||
if (typeof req.body === 'object') { | ||
for (var k in req.body) { | ||
bodyParams[k] = req.body[k]; | ||
} | ||
data[req.method] = scrubRequestParams(bodyParams); | ||
} else { | ||
data.body = req.body; | ||
} | ||
@@ -268,0 +273,0 @@ } |
@@ -12,2 +12,4 @@ var fs = require('fs'); | ||
exports.parseException = function(exc, callback) { | ||
var multipleErrs = getMultipleErrors(exc.errors); | ||
return exports.parseStack(exc.stack, function(err, stack) { | ||
@@ -25,2 +27,11 @@ if (err) { | ||
if (multipleErrs) { | ||
var firstErr = multipleErrs[0]; | ||
ret = { | ||
class: exc.name, | ||
message: firstErr.message, | ||
frames: stack | ||
} | ||
} | ||
var jadeMatch = message.match(jadeFramePattern); | ||
@@ -138,2 +149,22 @@ if (jadeMatch) { | ||
var getMultipleErrors = function(errors) { | ||
if (typeof errors === "undefined") | ||
return null; | ||
if (typeof errors !== "object") | ||
return null; | ||
if (errors instanceof Array) | ||
return errors; | ||
var errArray = []; | ||
for (var key in errors) { | ||
if (errors.hasOwnProperty(key)) { | ||
errArray.push(errors[key]); | ||
} | ||
} | ||
return errArray; | ||
} | ||
var parseJadeDebugFrame = function(body) { | ||
@@ -140,0 +171,0 @@ // Given a Jade exception body, return a frame object |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.2.6", | ||
"version": "0.2.8", | ||
"repository": "git://github.com/rollbar/node_rollbar.git", | ||
@@ -16,0 +16,0 @@ "author": "Cory Virok <cory@rollbar.com>", |
@@ -129,2 +129,8 @@ # Rollbar notifier for Node.js [![Build Status](https://secure.travis-ci.org/rollbar/node_rollbar.png?branch=master)](https://travis-ci.org/rollbar/node_rollbar) | ||
<dt>codeVersion</dt> | ||
<dd>The version or revision of your code. | ||
e.g. `'868ff435d6a480929103452e5ebe8671c5c89f77'` | ||
</dd> | ||
<dt>scrubFields</dt> | ||
@@ -131,0 +137,0 @@ <dd>List of field names to scrub out of POST. Values will be replaced with astrickses. If overriding, make sure to list all fields you want to scrub, not just fields you want to add to the default. Param names are converted to lowercase before comparing against the scrub list. |
@@ -85,2 +85,3 @@ var util = require('util'); | ||
* branch - the branch in your version control system for this code | ||
* codeVersion - the version or revision of your code | ||
* | ||
@@ -87,0 +88,0 @@ */ |
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
40228
1032
154