amazon-ppc-api
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -582,19 +582,12 @@ const querystring = require("querystring"); | ||
if (this.options.logging) { | ||
console.log(`${method} ${url}`); | ||
console.log("Request params: ", data); | ||
console.log("Request options: ", requestOptions); | ||
} | ||
try { | ||
response = await needle( | ||
method, | ||
url, | ||
JSONbig.stringify(data), | ||
requestOptions | ||
); | ||
let payload = data ? JSONbig.stringify(data) : data; | ||
if (this.options.logging) { | ||
console.log(`Response: ${response.body}`); | ||
console.log(`${method} ${url}`); | ||
console.log("Request params: ", payload); | ||
console.log("Request options: ", requestOptions); | ||
} | ||
response = await needle(method, url, payload, requestOptions); | ||
} catch (error) { | ||
@@ -608,3 +601,4 @@ requestFailed = true; | ||
response.statusCode == "500" || | ||
response.statusCode == "401" | ||
response.statusCode == "401" || | ||
response.statusCode == "400" | ||
) { | ||
@@ -611,0 +605,0 @@ if (this.options.logging) { |
{ | ||
"name": "amazon-ppc-api", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "This class helps you interfacing the Amazon Advertising API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
49977
577