feat: add recordErrorLog option to NewAPIError for conditional error logging

This commit is contained in:
CaIon committed 2025-08-02 11:07:50 +08:00
1 parent 2d4149c5dc
commit 7d4c9955f1
3 files changed
+28 -10

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ func relayHandler(c *gin.Context, relayMode int) *types.NewAPIError {
err = relay.TextHelper(c)
}
if constant2.ErrorLogEnabled && err != nil {
if constant2.ErrorLogEnabled && err != nil && types.IsRecordErrorLog(err) {
// 保存错误日志到mysql中
userId := c.GetInt("id")
tokenName := c.GetString("token_name")