{"record":{"id":"41c02915cffda10b","repo":"AlexxIT/go2rtc","slug":"wyze-failed-to-parse-login-response-w","errorCode":null,"errorMessage":"wyze: failed to parse login response: %w","messagePattern":"wyze: failed to parse login response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/cloud.go","lineNumber":133,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar errResp apiError\n\t_ = json.Unmarshal(body, &errResp)\n\tif errResp.hasError() {\n\t\treturn fmt.Errorf(\"wyze: login failed (code %s): %s\", errResp.code(), errResp.message())\n\t}\n\n\tvar result loginResponse\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn fmt.Errorf(\"wyze: failed to parse login response: %w\", err)\n\t}\n\n\tif len(result.MFAOptions) > 0 {\n\t\treturn &AuthError{\n\t\t\tMessage:  \"MFA required\",\n\t\t\tNeedsMFA: true,\n\t\t\tMFAType:  strings.Join(result.MFAOptions, \",\"),\n\t\t}\n\t}\n\n\tif result.AccessToken == \"\" {\n\t\treturn errors.New(\"wyze: no access token in response\")\n\t}\n\n\tc.accessToken = result.AccessToken\n\n\treturn nil\n}","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/cloud.go#L115-L151","documentation":"The Wyze login response had no API error but its body could not be parsed into loginResponse, meaning an unexpected/malformed JSON payload was returned. Wraps the unmarshal error; raised in Login (also via LoginWithCaptcha).","triggerScenarios":"Thrown at pkg/wyze/cloud.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the login request","Update loginResponse fields to match the current Wyze API"],"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"}