From 83ffc2e24b02be3c886cae5b4315d6383b621332 Mon Sep 17 00:00:00 2001 From: Denis Golovin Date: Fri, 3 May 2024 15:30:37 -0700 Subject: [PATCH] fix: check for error field when lookinf for cause of error Signed-off-by: Denis Golovin --- lib/modem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modem.js b/lib/modem.js index 6e60587..168e0c1 100644 --- a/lib/modem.js +++ b/lib/modem.js @@ -382,7 +382,7 @@ Modem.prototype.buildPayload = function (err, isStream, statusCodes, openStdin, var msg = new Error( '(HTTP code ' + res.statusCode + ') ' + (statusCodes[res.statusCode] || 'unexpected') + ' - ' + - (cause.message || cause) + ' ' + (cause.message || cause.error || cause) + ' ' ); msg.reason = statusCodes[res.statusCode]; msg.statusCode = res.statusCode;