diff --git a/lib/client.js b/lib/client.js index 275c6db..263b9b1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -98,7 +98,7 @@ client.prototype.request = function(method, path, params, callback){ }); res.on("end", function(){ - var error = null; + var error = new Error("An unknown error occurred"); try{ data = json.parse(data); }catch(e){} if(data["errors"]){ error = data["errors"];