diff --git a/lib/http_client.js b/lib/http_client.js index 1578fc7..bfcb8fc 100644 --- a/lib/http_client.js +++ b/lib/http_client.js @@ -115,7 +115,7 @@ client.prototype.request = function(method, path, params, callback){ }); res.on('end', function(){ - error = null; + var error = null; try{ data = JSON.parse(data); }catch(e){} if(data['errors']){ error = data['errors'];