diff --git a/tools/server/public_simplechat/readme.md b/tools/server/public_simplechat/readme.md index 0aff20789f..197b5329eb 100644 --- a/tools/server/public_simplechat/readme.md +++ b/tools/server/public_simplechat/readme.md @@ -674,6 +674,8 @@ sliding window based drop off or even before they kick in, this can help in many rss files, because it will return empty content, because there wont be any html content to strip the tags and unwanted blocks before returning. +* capture the body of ai server not ok responses, to help debug as well as to show same to user. + #### ToDo diff --git a/tools/server/public_simplechat/simplechat.js b/tools/server/public_simplechat/simplechat.js index 5a096ab7d5..022d26744f 100644 --- a/tools/server/public_simplechat/simplechat.js +++ b/tools/server/public_simplechat/simplechat.js @@ -732,7 +732,8 @@ class SimpleChat { }); if (resp.status >= 300) { - throw new ChatHSError(`HandleChatHS:GotResponse:NotOk:${resp.status}:${resp.statusText}`); + let respBody = await resp.text(); + throw new ChatHSError(`HandleChatHS:GotResponse:NotOk:${resp.status}:${resp.statusText}:${respBody}`); } return this.handle_response(resp, apiEP, elDivChat);