feat: add recordErrorLog option to NewAPIError for conditional error logging

This commit is contained in:
CaIon
2025-08-02 11:07:50 +08:00
parent 2d4149c5dc
commit 7d4c9955f1
3 changed files with 28 additions and 10 deletions
+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")