Skip to content

Commit

Permalink
fix: check for error field when lookinf for cause of error
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Golovin <[email protected]>
  • Loading branch information
dgolovin committed May 3, 2024
1 parent 049e1aa commit 83ffc2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/modem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 83ffc2e

Please sign in to comment.