From 5de6534b11ce91e50820b4ed442660fb9d2c067e Mon Sep 17 00:00:00 2001 From: ydshah2 Date: Tue, 12 May 2020 16:57:03 -0400 Subject: [PATCH] Fix JSON parse error in search when http request fails --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 1aceaf7..f4f303f 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -105,7 +105,7 @@ function apiCall(config, endpoint, method, params, callback) { return callback('Access token invalid. If you created or changed your password recently, ' + 'please run \'logdna login\' again. Type \'logdna --help\' for more info.'); } - return callback('Error: ' + body.error || error); + return callback('Error: ' + error || body.error); } callback(null, body); });