chenhg5/cc-connect · error

%s: update card entity: parse response: %w

Error message

%s: update card entity: parse response: %w

What it means

updateCardEntity got a successful HTTP response but could not json.Unmarshal the CardKit response body into the expected code/msg structure. Wraps the parse error; the update's business-level result is unknown.

Source

Thrown at platform/feishu/feishu.go:5393

		"sequence": seq,
	}
	var apiResp *larkcore.ApiResp
	if err := p.withFreshTenantAccessTokenRetry(ctx, "update card entity", func(client *lark.Client, options ...larkcore.RequestOptionFunc) error {
		var err error
		apiResp, err = client.Put(ctx, apiPath, body, larkcore.AccessTokenTypeTenant, options...)
		return err
	}); err != nil {
		return fmt.Errorf("%s: update card entity: %w", p.tag(), err)
	}
	if apiResp == nil || apiResp.StatusCode != http.StatusOK {
		return fmt.Errorf("%s: update card entity: HTTP status %d", p.tag(), apiResp.StatusCode)
	}
	var resp struct {
		Code int    `json:"code"`
		Msg  string `json:"msg"`
	}
	if err := json.Unmarshal(apiResp.RawBody, &resp); err != nil {
		return fmt.Errorf("%s: update card entity: parse response: %w", p.tag(), err)
	}
	if resp.Code != 0 {
		return fmt.Errorf("%s: %w", p.tag(), classifyFeishuCardAPIError("update card entity", resp.Code, resp.Msg))
	}
	return nil
}

func (p *Platform) Stop() error {
	// Issue #1618: stop the background supervisor that retries the
	// bot-info API when startup discovery fails. Without this the
	// goroutine could outlive the platform and leak into the next
	// start cycle.
	p.stopGroupFilterSupervisor()
	if p.isWSPrimary {
		remaining := unregisterSharedWS(p)
		if remaining > 0 {
			slog.Warn(p.tag()+": primary shutting down, secondary platforms will lose event source",
				"remaining", remaining)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Retry; check for API gateway/proxy interference
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at platform/feishu/feishu.go:5393 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/8bcb240096d0ee99. Report an issue: GitHub.