chenhg5/cc-connect · error

webex: deleteDevice status %d

Error message

webex: deleteDevice status %d

What it means

The DELETE against the WDM device URL returned a status other than the accepted success set (200, 204, 202). It means the device deregistration was not acknowledged — typically 401/403 auth issues, 404 for an already-deleted device, or a server error. The function treats empty deviceURL as a no-op, so this only fires for a real URL.

Source

Thrown at platform/webex/client.go:162

	}
	var d device
	if err := json.NewDecoder(resp.Body).Decode(&d); err != nil {
		return nil, err
	}
	return &d, nil
}

func (c *httpClient) DeleteDevice(ctx context.Context, deviceURL string) error {
	if deviceURL == "" {
		return nil
	}
	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

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Treat 404 as success (device already gone) by adding it to the accepted status set or handling it at the call site
  2. For 401/403, refresh the bot token and retry once
  3. Log the status and body to identify WDM-side rejections
  4. On 5xx, retry with backoff; device deletion is idempotent so a repeat call is safe
Defensive patterns

Strategy: validation

When it happens

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