{"record":{"id":"6a1db7fadf8936c8","repo":"chenhg5/cc-connect","slug":"webex-deletedevice-status-d","errorCode":null,"errorMessage":"webex: deleteDevice status %d","messagePattern":"webex: deleteDevice status (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/webex/client.go","lineNumber":162,"sourceCode":"\t}\n\tvar d device\n\tif err := json.NewDecoder(resp.Body).Decode(&d); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &d, nil\n}\n\nfunc (c *httpClient) DeleteDevice(ctx context.Context, deviceURL string) error {\n\tif deviceURL == \"\" {\n\t\treturn nil\n\t}\n\tresp, err := c.doWithRetry(ctx, http.MethodDelete, deviceURL, nil, \"\", \"webex: deleteDevice\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusAccepted {\n\t\treturn fmt.Errorf(\"webex: deleteDevice status %d\", resp.StatusCode)\n\t}\n\treturn nil\n}\n\nfunc (c *httpClient) GetMessage(ctx context.Context, id string) (*message, error) {\n\tresp, err := c.doWithRetry(ctx, http.MethodGet, c.base()+\"/messages/\"+id, nil, \"\", \"webex: getMessage\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"webex: getMessage status %d\", resp.StatusCode)\n\t}\n\tvar m message\n\tif err := json.NewDecoder(resp.Body).Decode(&m); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &m, nil","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/webex/client.go#L144-L180","documentation":"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.","triggerScenarios":"Thrown at platform/webex/client.go:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat 404 as success (device already gone) by adding it to the accepted status set or handling it at the call site","For 401/403, refresh the bot token and retry once","Log the status and body to identify WDM-side rejections","On 5xx, retry with backoff; device deletion is idempotent so a repeat call is safe"],"exampleFix":null,"handlingStrategy":"validation","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"}