chore: error recover is enable ONLY in debug mode

This commit is contained in:
RockYang
2024-01-06 17:16:02 +08:00
parent 2f8d2f4854
commit 76c5101092
2 changed files with 15 additions and 11 deletions

View File

@@ -9,12 +9,13 @@ import (
"context"
"encoding/json"
"fmt"
req2 "github.com/imroc/req/v3"
"html/template"
"io"
"strings"
"time"
"unicode/utf8"
req2 "github.com/imroc/req/v3"
)
// OPenAI 消息发送实现
@@ -137,7 +138,7 @@ func (h *ChatHandler) sendOpenAiMessage(
if err != nil {
errMsg = err.Error()
} else if r.IsErrorState() {
errMsg = r.Err.Error()
errMsg = r.Status
}
if errMsg != "" || apiRes.Code != types.Success {
msg := "调用函数工具出错:" + apiRes.Message + errMsg