From 8aef03b0529b1621b311e51c9dca881d1163dd4c Mon Sep 17 00:00:00 2001 From: Manish Date: Thu, 19 Sep 2019 11:55:32 +0530 Subject: [PATCH] server_busy_bug_fix --- splunklogger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/splunklogger.js b/splunklogger.js index 7524f7f..53ed8ca 100644 --- a/splunklogger.js +++ b/splunklogger.js @@ -481,7 +481,7 @@ SplunkLogger.prototype._sendEvents = function(context, callback) { // Try to parse an error response from Splunk Enterprise or Splunk Cloud if (!splunkError && _body && _body.code && _body.code.toString() !== "0") { - splunkError = new Error(_body.text); + splunkError = new Error(_body.text || _body); splunkError.code = _body.code; }