From d04fbc792eba0443025fb3f264e108007562009b Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 10 Mar 2025 20:51:00 +0300 Subject: refactor: Improve error logging and add comment for error handling in sendMsgToLLM --- bot.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index 7d9fbe9..aecc0b9 100644 --- a/bot.go +++ b/bot.go @@ -186,10 +186,12 @@ func sendMsgToLLM(body io.Reader) { } content, stop, err = chunkParser.ParseChunk(line) if err != nil { - logger.Error("error parsing response body", "error", err, "line", string(line), "url", cfg.CurrentAPI) + logger.Error("error parsing response body", "error", err, + "line", string(line), "url", cfg.CurrentAPI) streamDone <- true break } + // here line can contain some error msg; if it does we should log it and break from loop; ai! if stop { if content != "" { logger.Warn("text inside of finish llmchunk", "chunk", content, "counter", counter) -- cgit v1.2.3