Browse Source

Set unknown error instead of null for res on end

pull/84/head
cbeanLeadr 3 years ago
parent
commit
e75c38574b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/client.js

+ 1
- 1
lib/client.js View File

@ -98,7 +98,7 @@ client.prototype.request = function(method, path, params, callback){
}); });
res.on("end", function(){ res.on("end", function(){
var error = null;
var error = new Error("An unknown error occurred");
try{ data = json.parse(data); }catch(e){} try{ data = json.parse(data); }catch(e){}
if(data["errors"]){ if(data["errors"]){
error = data["errors"]; error = data["errors"];


Loading…
Cancel
Save