refactor: improve request type validation and enhance sensitive information masking

This commit is contained in:
CaIon
2025-08-15 13:20:36 +08:00
parent dba74e5b05
commit 8eb17f24bb
11 changed files with 87 additions and 102 deletions
-9
View File
@@ -121,15 +121,6 @@ func (e *NewAPIError) MaskSensitiveError() string {
return string(e.errorCode)
}
errStr := e.Err.Error()
if e.StatusCode == http.StatusServiceUnavailable {
if e.errorCode == ErrorCodeModelNotFound {
errStr = "上游分组模型服务不可用,请稍后再试"
} else {
if strings.Contains(errStr, "分组") || strings.Contains(errStr, "渠道") {
errStr = "上游分组模型服务不可用,请稍后再试"
}
}
}
return common.MaskSensitiveInfo(errStr)
}