{"record":{"id":"06ec173c9af182a4","repo":"chenhg5/cc-connect","slug":"s-update-card-entity-http-status-d","errorCode":null,"errorMessage":"%s: update card entity: HTTP status %d","messagePattern":"(.+?): update card entity: HTTP status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":5386,"sourceCode":"\n\tapiPath := fmt.Sprintf(\"/open-apis/cardkit/v1/cards/%s\", cardID)\n\tbody := map[string]any{\n\t\t\"card\": map[string]any{\n\t\t\t\"type\": \"card_json\",\n\t\t\t\"data\": cardJSON,\n\t\t},\n\t\t\"sequence\": seq,\n\t}\n\tvar apiResp *larkcore.ApiResp\n\tif err := p.withFreshTenantAccessTokenRetry(ctx, \"update card entity\", func(client *lark.Client, options ...larkcore.RequestOptionFunc) error {\n\t\tvar err error\n\t\tapiResp, err = client.Put(ctx, apiPath, body, larkcore.AccessTokenTypeTenant, options...)\n\t\treturn err\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"%s: update card entity: %w\", p.tag(), err)\n\t}\n\tif apiResp == nil || apiResp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"%s: update card entity: HTTP status %d\", p.tag(), apiResp.StatusCode)\n\t}\n\tvar resp struct {\n\t\tCode int    `json:\"code\"`\n\t\tMsg  string `json:\"msg\"`\n\t}\n\tif err := json.Unmarshal(apiResp.RawBody, &resp); err != nil {\n\t\treturn fmt.Errorf(\"%s: update card entity: parse response: %w\", p.tag(), err)\n\t}\n\tif resp.Code != 0 {\n\t\treturn fmt.Errorf(\"%s: %w\", p.tag(), classifyFeishuCardAPIError(\"update card entity\", resp.Code, resp.Msg))\n\t}\n\treturn nil\n}\n\nfunc (p *Platform) Stop() error {\n\t// Issue #1618: stop the background supervisor that retries the\n\t// bot-info API when startup discovery fails. Without this the\n\t// goroutine could outlive the platform and leak into the next","sourceCodeStart":5368,"sourceCodeEnd":5404,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L5368-L5404","documentation":"updateCardEntity's PUT to the CardKit /cards/{card_id} endpoint returned a non-HTTP-200 status. Indicates the card entity update (used for typewriter streaming) failed server-side or the card_id is invalid.","triggerScenarios":"Thrown at platform/feishu/feishu.go:5386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check status: 404 card deleted, 429 throttled — back off accordingly","Fall back to Im.Message.Patch if cardkit remains unavailable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}