{"record":{"id":"28f40186104c28c4","repo":"AlexxIT/go2rtc","slug":"wyze-failed-to-parse-device-list-w","errorCode":null,"errorMessage":"wyze: failed to parse device list: %w","messagePattern":"wyze: failed to parse device list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/cloud.go","lineNumber":187,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := c.client.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar result deviceListResponse\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn nil, fmt.Errorf(\"wyze: failed to parse device list: %w\", err)\n\t}\n\n\tif result.Code != \"1\" {\n\t\treturn nil, fmt.Errorf(\"wyze: API error: %s - %s\", result.Code, result.Msg)\n\t}\n\n\tc.cameras = nil\n\tfor _, dev := range result.Data.DeviceList {\n\t\tif dev.ProductType != \"Camera\" {\n\t\t\tcontinue\n\t\t}\n\t\tif dev.DeviceParams.IP == \"\" {\n\t\t\tcontinue // skip cameras without IP (gwell protocol)\n\t\t}\n\n\t\tc.cameras = append(c.cameras, &Camera{\n\t\t\tMAC:          dev.MAC,\n\t\t\tP2PID:        dev.DeviceParams.P2PID,","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/cloud.go#L169-L205","documentation":"The Wyze device-list endpoint returned JSON that could not be unmarshaled into deviceListResponse, so GetCameraList cannot enumerate cameras. Wraps the unmarshal error; also breaks GetCamera, which calls it lazily.","triggerScenarios":"Thrown at pkg/wyze/cloud.go:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request","Update deviceListResponse to match the current Wyze API schema"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}