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 ef0db0f914
commit 6abbd036f8
3 changed files with 28 additions and 10 deletions

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")