{"record":{"id":"780655639621248b","repo":"AlexxIT/go2rtc","slug":"wrong-request","errorCode":null,"errorMessage":"wrong request","messagePattern":"wrong request","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"internal/xiaomi/xiaomi.go","lineNumber":322,"sourceCode":"\t}\n\n\tusername := r.Form.Get(\"username\")\n\tpassword := r.Form.Get(\"password\")\n\tcaptcha := r.Form.Get(\"captcha\")\n\tverify := r.Form.Get(\"verify\")\n\n\tvar err error\n\n\tswitch {\n\tcase username != \"\" || password != \"\":\n\t\tauth = xiaomi.NewCloud(AppXiaomiHome)\n\t\terr = auth.Login(username, password)\n\tcase captcha != \"\":\n\t\terr = auth.LoginWithCaptcha(captcha)\n\tcase verify != \"\":\n\t\terr = auth.LoginWithVerify(verify)\n\tdefault:\n\t\thttp.Error(w, \"wrong request\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif err == nil {\n\t\tuserID, token := auth.UserToken()\n\t\tauth = nil\n\n\t\tcloudsMu.Lock()\n\t\tif tokens == nil {\n\t\t\ttokens = map[string]string{userID: token}\n\t\t} else {\n\t\t\ttokens[userID] = token\n\t\t}\n\t\tcloudsMu.Unlock()\n\n\t\terr = app.PatchConfig([]string{\"xiaomi\", userID}, token)\n\t}\n","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/xiaomi/xiaomi.go#L304-L340","documentation":"apiAuth's switch found none of the expected field combinations: no username/password pair, no captcha, and no verify code were provided, so no login variant can be attempted. Rejects with 400; a generic input-validation guard.","triggerScenarios":"Thrown at internal/xiaomi/xiaomi.go:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Submit username+password, captcha, or verify — at least one authentication input"],"exampleFix":null,"handlingStrategy":"validation","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"}