Repository navigation
docs: 补上「流内 error 事件的 statusCode 会被采纳并映射」的说明 - #59
Open
Catapult291 wants to merge 1 commit into
Open
Catapult291 wants to merge 1 commit into
Catapult291 wants to merge 1 commit into
Conversation
说明 CC 通过 SSE error 事件上报失败时,代理优先采用消息 <NNN> 前缀或 error.statusCode,并按 CC_STATUS_MAP 映射。
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.
背景
README 的
CC_STATUS_MAP表列出了上游状态码到下游的映射,但没说明流内错误事件这条路径:CC 失败时不一定在 HTTP 层报错,而是在 200 的响应流里发代理会取这个状态(消息里的
<NNN>前缀优先,与 CLI 的readStreamErrorEvent一致),按与 HTTP 层错误相同的方式映射(声明的 402 仍落 429)。缺这段说明时,读者会以为CC_STATUS_MAP只作用于 HTTP 层错误,看不出「上游声明的 400 / 429 会带着自己的状态到达客户端,而不是一律折叠成 502」。改动
README.md/README_zh.md:在CC_STATUS_MAP表与error.code透传说明之后各补一段(+2 / +2)。只动文档,无代码行为变更。说明
这个改动最初随 #48 提过一次,当时基于重写前的 README 结构;#48 关闭后上游重写了文档(错误码表挪位、新增
CC_STATUS_MAP表),因此按当前 README 重做了一版,git apply到ce5a217无冲突。