From b3f50e9dd07b31fef33fb78c0d5c3978960bcd68 Mon Sep 17 00:00:00 2001 From: CaIon Date: Tue, 14 Oct 2025 13:53:30 +0800 Subject: [PATCH] fix: remove redundant error message details for channel retrieval failures --- controller/relay.go | 2 +- middleware/distributor.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/relay.go b/controller/relay.go index 4a81e3565..f52fb4815 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -229,7 +229,7 @@ func getChannel(c *gin.Context, group, originalModel string, retryCount int) (*m return nil, types.NewError(fmt.Errorf("获取分组 %s 下模型 %s 的可用渠道失败(retry): %s", selectGroup, originalModel, err.Error()), types.ErrorCodeGetChannelFailed, types.ErrOptionWithSkipRetry()) } if channel == nil { - return nil, types.NewError(fmt.Errorf("分组 %s 下模型 %s 的可用渠道不存在(数据库一致性已被破坏,retry)", selectGroup, originalModel), types.ErrorCodeGetChannelFailed, types.ErrOptionWithSkipRetry()) + return nil, types.NewError(fmt.Errorf("分组 %s 下模型 %s 的可用渠道不存在(retry)", selectGroup, originalModel), types.ErrorCodeGetChannelFailed, types.ErrOptionWithSkipRetry()) } newAPIError := middleware.SetupContextForSelectedChannel(c, channel, originalModel) if newAPIError != nil { diff --git a/middleware/distributor.go b/middleware/distributor.go index 1cc5d2cea..2ff79e6ca 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -102,7 +102,7 @@ func Distribute() func(c *gin.Context) { if userGroup == "auto" { showGroup = fmt.Sprintf("auto(%s)", selectGroup) } - message := fmt.Sprintf("获取分组 %s 下模型 %s 的可用渠道失败(数据库一致性已被破坏,distributor): %s", showGroup, modelRequest.Model, err.Error()) + message := fmt.Sprintf("获取分组 %s 下模型 %s 的可用渠道失败(distributor): %s", showGroup, modelRequest.Model, err.Error()) // 如果错误,但是渠道不为空,说明是数据库一致性问题 //if channel != nil { // common.SysError(fmt.Sprintf("渠道不存在:%d", channel.Id))