fix(provider): 统一响应体超时错误分类
将收到响应头后在读取 JSON 或 Veo 视频响应体阶段发生的 deadline/网络超时统一归类为 terminal timeout,保留 HTTP 状态、request ID 和 wire 证据,避免继续返回 response_read_error。 验证:go test ./... -count=1;go test ./internal/clients ./internal/runner -count=1;go vet ./internal/clients ./internal/runner;gofmt。
This commit is contained in:
@@ -73,6 +73,12 @@ func decodeHTTPResponseForProtocol(resp *http.Response, protocol string) (map[st
|
||||
if len(raw) > 0 {
|
||||
_ = json.Unmarshal(raw, &wire.Body)
|
||||
}
|
||||
if timeoutErr := transportClientError(readErr); timeoutErr.Code == "timeout" {
|
||||
timeoutErr.StatusCode = resp.StatusCode
|
||||
timeoutErr.RequestID = requestIDFromHTTPResponse(resp)
|
||||
timeoutErr.Wire = wire
|
||||
return nil, wire, timeoutErr
|
||||
}
|
||||
return nil, wire, &ClientError{
|
||||
Code: "response_read_error",
|
||||
Message: readErr.Error(),
|
||||
|
||||
Reference in New Issue
Block a user