Skip to content

Commit

Permalink
Merge pull request #172 from dgolovin/issue-171
Browse files Browse the repository at this point in the history
fix: check for error field when looking for cause of error
  • Loading branch information
apocas authored Jan 3, 2025
2 parents aadd5d8 + 9844c3a commit 5cb5a50
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 5cb5a50

Please sign in to comment.