From f0600b2a26b32aaace6a4309acdf484028a8c52c Mon Sep 17 00:00:00 2001 From: egorvas Date: Fri, 15 Dec 2023 14:16:42 +0100 Subject: [PATCH] Add additional logging in case of _postBulkAPI request exeption --- MonitorClient.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MonitorClient.js b/MonitorClient.js index 77febc8..76fa8f7 100644 --- a/MonitorClient.js +++ b/MonitorClient.js @@ -592,12 +592,13 @@ class MonitorClient extends EventEmitter { try { json = e.response.data ? e.response.data : JSON.parse(e.response.body); } catch (jsonException) { - // do nothing + this.log(`Impossible to parse JSON body: ${e.response.body}`); } if (json && json.error) { this.log(`Monitor API Error [code ${json.error.code}]: ${json.error.message}`); } } + this.log(e); throw new Error(`${url} POST ${errorMessages.request_failed} ${e.message}`); } return result;