Repository navigation
docs: 错误码表补上「采纳上游 error.statusCode」的语义(#43 文档补充) - #48
Closed
Catapult291 wants to merge 1 commit into
Closed
Catapult291 wants to merge 1 commit into
Catapult291 wants to merge 1 commit into
Conversation
#43 让 mapCcEventError 采纳 error 事件自带的 statusCode 之后,README / README_zh 的错误码表没跟上:仍写着「400 = 请求格式错误」、「502 = CC 上游错误」, 看不出上游声明的状态码现在会原样透出。 - 400 行补上「或上游 error 事件自带 statusCode: 400(如内容风控拒绝)」 - 502 行收窄为「事件未声明状态码,或声明的状态码不在映射表内」 - 两表下各补一段说明:CC 把失败放在响应流里上报 ({"type":"error","error":{...,"statusCode":N,"isRetryable":B}}),代理取值 顺序是 `<NNN>` 前缀优先、其次 statusCode(与 CLI 的 readStreamErrorEvent 一致), 映射方式与 HTTP 层错误相同(声明的 402 仍落 429)。 只改文档,无代码行为变更。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#43 让
mapCcEventError采纳 error 事件自带的statusCode之后,README / README_zh 的「错误码」表没跟上,仍写着:这两个描述现在都不准:
<NNN>前缀):上游返回的是HTTP 200+ 流内事件{"type":"error","error":{"type":"server_error","message":"Content Exists Risk","statusCode":400,"isRetryable":false}},现版本按
statusCode: 400回400 invalid_request_error;改之前一律回502 upstream_error,下游还会把它当成可重试的上游故障。502现在只剩两种情况:事件没声明状态码,或声明的状态码不在CC_STATUS_MAP里。改动(只动文档):
statusCode: 400(如内容风控拒绝)」<NNN>前缀优先、其次statusCode(与 CLI 的readStreamErrorEvent一致),映射方式与 HTTP 层错误相同(声明的 402 仍落 429)。无代码行为变更。以上描述按
9bdfafc的mapCcEventError逐句核对,并用真实请求复验过(同一模型:控制组 200,风控组 400)。