refactor(failover): 用 provider failover_rules 替代硬编码 ErrorClassifier 判断

移除 submit_with_failover 中基于 ErrorClassifier 的客户端错误硬编码逻辑,
改为读取 provider.config.failover_rules 进行规则匹配:
- error_stop_patterns: 错误响应命中时终止 failover
- success_failover_patterns: 2xx 响应命中时继续尝试下一个候选
同步更新相关注释、异常描述及测试用例
This commit is contained in:
fawney19
2026-03-02 22:21:13 +08:00
parent 0bff15f964
commit 8e98eed5c8
4 changed files with 174 additions and 46 deletions

View File

@@ -305,7 +305,7 @@ class VideoHandlerBase(ABC):
返回:
- 成功SubmitOutcome
- 上游客户端错误:直接返回脱敏后的 JSONResponse保留 API 格式差异)
- 命中上游终止规则:直接返回脱敏后的 JSONResponse保留 API 格式差异)
失败时:
- 无可用候选 / 全部失败:抛 HTTPException(503)