Comparing version 1.0.1 to 2.0.0
@@ -167,3 +167,4 @@ /* | ||
if (responseObj.statusCode !== 200) { | ||
throw new Error('Request did not return 200 OK'); | ||
callback(new Error('Request did not return 200 OK')); | ||
return; | ||
} | ||
@@ -181,3 +182,4 @@ | ||
if (!boundary) { | ||
throw new Error('Problem getting boundary data'); | ||
callback(new Error('Problem getting boundary data')); | ||
return; | ||
} | ||
@@ -261,3 +263,3 @@ | ||
// Extend data sent through as is for parse in callback | ||
callback(responseBody, _self._requestExtensionData); | ||
callback(null /* No error */ , responseBody, _self._requestExtensionData); | ||
@@ -264,0 +266,0 @@ }); |
{ | ||
"name": "batchelor", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "A lovely little Node.js module to perform batch requests with the Google REST API", | ||
@@ -5,0 +5,0 @@ "main": "./lib/batchelor", |
@@ -16,2 +16,18 @@ # Batchelor | ||
## Upgrading to 2.0 | ||
`batch.run(...)` now takes a node style callback, with an error as the first parameter and the result as the second. | ||
**INCORRECT** (old, v1.0-style): | ||
``` node | ||
batch.run(function(result){}); | ||
``` | ||
**CORRECT** (new, v2.0-style): | ||
``` node | ||
batch.run(function(err, result){}); | ||
``` | ||
## Upgrading to 1.0 | ||
@@ -178,2 +194,3 @@ | ||
* 2.0.0 Bug Fixes and Improvements | ||
* 1.0.0 The API was changed in 1.0 to move from a singleton instance to a constructor (Thanks again to [@bradvogel](https://github.com/bradvogel)) | ||
@@ -180,0 +197,0 @@ * 0.0.8 Added support for DELETE requests (Thanks to [@bradvogel](https://github.com/bradvogel)) |
16900
218
206