Comparing version 0.9.2 to 0.9.3
18
index.js
@@ -31,7 +31,17 @@ /*globals require,module */ | ||
res.on('end',function() { | ||
if ( buffer ) { | ||
resolve(toJSON(buffer)); | ||
if ( res.statusCode === 200 || res.statusCode === 204 || res.statusCode === 201 ) { | ||
if ( buffer ) { | ||
resolve(toJSON(buffer)); | ||
} else { | ||
resolve(); | ||
} | ||
} else { | ||
resolve(); | ||
if ( buffer ) { | ||
reject({statusCode: res.statusCode, res:toJSON(buffer)}); | ||
} else { | ||
reject({statusCode: res.statusCode}); | ||
} | ||
} | ||
}); | ||
@@ -456,3 +466,3 @@ }); | ||
DropKit.prototype.regions = function() { | ||
return createPromise(this.createOption({ method: 'GET' , path: "/v2/regionsx"})); | ||
return createPromise(this.createOption({ method: 'GET' , path: "/v2/regions"})); | ||
}; | ||
@@ -459,0 +469,0 @@ |
{ | ||
"name": "dropkit", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "A DigitalOcean Node.js module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,3 +22,4 @@ dropkit | ||
}).error(function(error) { | ||
console.log("something bad happened"); | ||
console.log("httpStatusCode: " + error.statusCode); | ||
console.log("response: " + error.res); | ||
}); | ||
@@ -25,0 +26,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
16791
433
119