refactor: Improve error logging and add comment for error handling in sendMsgToLLM
This commit is contained in:
committed by
Grail Finder (aider)
parent
cbd850bda8
commit
d04fbc792e
4
bot.go
4
bot.go
@@ -186,10 +186,12 @@ func sendMsgToLLM(body io.Reader) {
|
|||||||
}
|
}
|
||||||
content, stop, err = chunkParser.ParseChunk(line)
|
content, stop, err = chunkParser.ParseChunk(line)
|
||||||
if err != nil {
|
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
|
streamDone <- true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
// here line can contain some error msg; if it does we should log it and break from loop; ai!
|
||||||
if stop {
|
if stop {
|
||||||
if content != "" {
|
if content != "" {
|
||||||
logger.Warn("text inside of finish llmchunk", "chunk", content, "counter", counter)
|
logger.Warn("text inside of finish llmchunk", "chunk", content, "counter", counter)
|
||||||
|
|||||||
Reference in New Issue
Block a user