{"record":{"id":"ea5078686d0fcfbc","repo":"chenhg5/cc-connect","slug":"s-update-card-entity-w","errorCode":null,"errorMessage":"%s: update card entity: %w","messagePattern":"(.+?): update card entity: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":5383,"sourceCode":"\tcardID := h.cardID\n\tseq := h.sequence\n\th.mu.Unlock()\n\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 {","sourceCodeStart":5365,"sourceCodeEnd":5401,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L5365-L5401","documentation":"updateCardEntity wraps the cardkit v1 PUT (/open-apis/cardkit/v1/cards/{card_id}) transport failure inside the fresh-token retry layer; the full-card replacement for rich-mode (card_id reference) messages failed.","triggerScenarios":"Thrown at platform/feishu/feishu.go:5383 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check card_id validity and cardkit permissions","Retry on transient errors (token retry is built in)"],"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-14T00:17:10.932Z"}