Skip to content

Commit 323d070

Browse files
committed
SimpleChatTC:Get body also for Not Ok responses from ai server
Rather a chat with gpt-oss generated a assistant response which included chat-content, chat-reasoning and chat-toolcall all in the same response. On responding to same with tool call result, the server http handshake responded with a 500 Internal server error, So added this to get more details in this case, as well as in general for future.
1 parent 42a6b3c commit 323d070

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tools/server/public_simplechat/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,8 @@ sliding window based drop off or even before they kick in, this can help in many
674674
rss files, because it will return empty content, because there wont be any html content to strip the tags
675675
and unwanted blocks before returning.
676676

677+
* capture the body of ai server not ok responses, to help debug as well as to show same to user.
678+
677679

678680
#### ToDo
679681

tools/server/public_simplechat/simplechat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,8 @@ class SimpleChat {
732732
});
733733

734734
if (resp.status >= 300) {
735-
throw new ChatHSError(`HandleChatHS:GotResponse:NotOk:${resp.status}:${resp.statusText}`);
735+
let respBody = await resp.text();
736+
throw new ChatHSError(`HandleChatHS:GotResponse:NotOk:${resp.status}:${resp.statusText}:${respBody}`);
736737
}
737738

738739
return this.handle_response(resp, apiEP, elDivChat);

0 commit comments

Comments
 (0)