chenhg5/cc-connect · error

webex: getMessage status %d

Error message

webex: getMessage status %d

What it means

The Webex REST call GET /messages/{id} completed but returned a status other than 200 OK. This is a post-retry status guard: common causes are 401 (bad/expired token, covered by TestGetMessageUnauthorized) or a non-transient failure that doWithRetry's 429 backoff (TestGetMessageRetriesOn429) could not absorb.

Source

Thrown at platform/webex/client.go:174

	resp, err := c.doWithRetry(ctx, http.MethodDelete, deviceURL, nil, "", "webex: deleteDevice")
	if err != nil {
		return err
	}
	defer func() { _ = resp.Body.Close() }()
	if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusAccepted {
		return fmt.Errorf("webex: deleteDevice status %d", resp.StatusCode)
	}
	return nil
}

func (c *httpClient) GetMessage(ctx context.Context, id string) (*message, error) {
	resp, err := c.doWithRetry(ctx, http.MethodGet, c.base()+"/messages/"+id, nil, "", "webex: getMessage")
	if err != nil {
		return nil, err
	}
	defer func() { _ = resp.Body.Close() }()
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("webex: getMessage status %d", resp.StatusCode)
	}
	var m message
	if err := json.NewDecoder(resp.Body).Decode(&m); err != nil {
		return nil, err
	}
	return &m, nil
}

func (c *httpClient) DownloadFile(ctx context.Context, url string) (*downloadedFile, error) {
	resp, err := c.doWithRetry(ctx, http.MethodGet, url, nil, "", "webex: downloadFile")
	if err != nil {
		return nil, err
	}
	defer func() { _ = resp.Body.Close() }()
	if resp.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("webex: downloadFile status %d", resp.StatusCode)
	}
	data, err := io.ReadAll(resp.Body)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. On 401, re-issue the bot token and retry the fetch
  2. On 404, the message was deleted or is inaccessible; skip it rather than retrying
  3. Include the response body in logs to see the Webex error payload
  4. For persistent 5xx, back off and retry at the caller
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at platform/webex/client.go:174 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/ad5e7a7533ddda36. Report an issue: GitHub.