Skip to content

Commit 3d410dc

Browse files
committed
MLE-24763 Including server response body in error message
1 parent f4d3670 commit 3d410dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/responder.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,9 @@ function isResponseStatusOkay(response) {
10391039
((typeof contentType === 'string' || contentType instanceof String) &&
10401040
/^application\/([^+]+\+)?json(\s*;.*)?$/.test(contentType)) ?
10411041
mlutil.parseJSON(bodyMsg) : bodyMsg;
1042+
1043+
// Enhance error message with response body details for better debugging
1044+
clientError.message = clientError.message + ' - Server response: ' + bodyMsg;
10421045
}
10431046
operation.errorListener(clientError);
10441047
}));

0 commit comments

Comments
 (0)