Comparing version 2.0.1 to 2.0.2
@@ -48,2 +48,3 @@ /* | ||
options.method = options.method || 'POST'; // Default is POST as this was built specifically for Google | ||
if (!options.headers) options.headers = {}; | ||
options.headers['Content-Type'] = options.headers['Content-Type'] || 'multipart/mixed;'; | ||
@@ -268,2 +269,5 @@ | ||
responseObj.pipe(d); | ||
}).on('error', function (err) { | ||
// report socket errors to the callback function | ||
callback(err); | ||
}); | ||
@@ -270,0 +274,0 @@ }; |
{ | ||
"name": "batchelor", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A lovely little Node.js module to perform batch requests with the Google REST API", | ||
@@ -5,0 +5,0 @@ "main": "./lib/batchelor", |
@@ -108,4 +108,9 @@ # Batchelor | ||
``` node | ||
batch.run(function(response){ | ||
res.json(response); | ||
batch.run(function(err, response){ | ||
if (err){ | ||
console.log("Error: " + err.toString()); | ||
} | ||
else { | ||
res.json(response); | ||
} | ||
}); | ||
@@ -194,2 +199,3 @@ ``` | ||
* 2.0.2 Added [error handler](https://github.com/wapisasa/batchelor/pull/15) and [made `headers` optional](https://github.com/wapisasa/batchelor/pull/17) | ||
* 2.0.1 Include response status code in error | ||
@@ -196,0 +202,0 @@ * 2.0.0 Bug Fixes and Improvements |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17360
222
213
2