From e75c38574b94b46b974e0fb3d4a6389ce643b177 Mon Sep 17 00:00:00 2001 From: cbeanLeadr Date: Wed, 8 Mar 2023 11:37:16 -0500 Subject: [PATCH] Set unknown error instead of null for res on end --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"];