Comparing version 0.4.2 to 0.4.3
@@ -8,3 +8,3 @@ 'use strict'; | ||
var API_BASE = "http://api-m2x.att.com/v1"; | ||
var USER_AGENT = "M2X/0.4.2 (node.js)"; | ||
var USER_AGENT = "M2X/0.4.3 (node.js)"; | ||
@@ -69,4 +69,12 @@ var Client = function(apiKey, apiBase) { | ||
if (cb) { | ||
var data = body ? JSON.parse(body) : {}; | ||
// TODO: make sure there are no problems parsing JSON? | ||
var data = null; | ||
if (! error) { | ||
try { | ||
data = body ? JSON.parse(body) : {}; | ||
} catch (ex) { | ||
error = ex.toString(); | ||
} | ||
} | ||
cb.call(this, data, error, response); | ||
@@ -73,0 +81,0 @@ } |
{ | ||
"name": "m2x", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "AT&T M2X API client for node.js", | ||
@@ -5,0 +5,0 @@ "main": "./lib/m2x", |
@@ -476,3 +476,3 @@ # Node.js M2X API Client # | ||
This gem is delivered under the MIT license. See [LICENSE](LICENSE) for the terms. | ||
This library is provided under the MIT license. See [LICENSE](LICENSE) for applicable terms. | ||
@@ -479,0 +479,0 @@ |
40567
595