@google-cloud/common
Advanced tools
Comparing version 0.18.8 to 0.18.9
@@ -58,2 +58,3 @@ "use strict"; | ||
var extend = require("extend"); | ||
var is = require("is"); | ||
var pify = require("pify"); | ||
@@ -179,6 +180,16 @@ var util_1 = require("./util"); | ||
* Note: this returns an array of results in the form of a | ||
* BodyResponseCallback, which means: [body, response]. Return the | ||
* response object in the promise result. | ||
* BodyResponseCallback, which means: [body, response]. Return | ||
* the response object in the promise result. | ||
*/ | ||
return args.length > 1 ? args[1] : null; | ||
}, function (e) { | ||
if (is.array(e) && e.length > 0) { | ||
var err = e[0], body = e[1], res = e[2]; | ||
if (res) { | ||
res.body = err; | ||
err.response = res; | ||
} | ||
throw err; | ||
} | ||
throw e; | ||
}); | ||
@@ -191,3 +202,3 @@ } | ||
} | ||
this.request_(reqOpts).then(function (res) { return callback(null, res.body, res); }, function (err) { return callback(err, null, null); }); | ||
this.request_(reqOpts).then(function (res) { return callback(null, res.body, res); }, function (err) { return callback(err, err.response ? err.response.body : undefined, err.response); }); | ||
}; | ||
@@ -194,0 +205,0 @@ /** |
{ | ||
"name": "@google-cloud/common", | ||
"description": "Common components for Cloud APIs Node.js Client Libraries", | ||
"version": "0.18.8", | ||
"version": "0.18.9", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "author": "Google Inc.", |
Sorry, the diff of this file is not supported yet
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
171110
2870