mastercard-api-core
Advanced tools
Comparing version 0.0.1 to 0.0.2
13
index.js
@@ -144,8 +144,17 @@ /* | ||
if (statusCode < 300) { | ||
var jsonResponse = null; | ||
try { | ||
var jsonResponse = JSON.parse(httpResponseData); | ||
callback(null, jsonResponse); | ||
jsonResponse = JSON.parse(httpResponseData); | ||
} | ||
catch (e) { | ||
console.error("Error parsing json response. Status: " + statusCode) | ||
} | ||
// NB: Don't want to call callback in catch above as if the callback function throws an error it | ||
// will go back into the catch | ||
if (jsonResponse) { | ||
callback(null, jsonResponse); | ||
} | ||
else { | ||
callback(new mastercardError.APIError('Error parsing JSON response', httpResponseData, 500), null); | ||
@@ -152,0 +161,0 @@ } |
{ | ||
"name": "mastercard-api-core", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Core functionality for MasterCard API", | ||
@@ -18,3 +18,3 @@ "main": "index.js", | ||
"author": "Eamon Doyle <eamon.doyle@mastercard.com> (https://developer.mastercard.com)", | ||
"license": "ISC", | ||
"license": "BSD-2-Clause", | ||
"devDependencies": { | ||
@@ -21,0 +21,0 @@ "istanbul": "^0.4.2", |
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
32039
813