{"record":{"id":"6d375ee2baa3befe","repo":"AlexxIT/go2rtc","slug":"wrong-response-s","errorCode":null,"errorMessage":"wrong response: %s","messagePattern":"wrong response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/dvrip/client.go","lineNumber":231,"sourceCode":"\n\treturn\n}\n\ntype Response map[string]any\n\nfunc (c *Client) ReadJSON() (res Response, err error) {\n\tb, err := c.ReadChunk()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tres = Response{}\n\tif err = json.Unmarshal(b[:len(b)-2], &res); err != nil {\n\t\treturn\n\t}\n\n\tif v, ok := res[\"Ret\"].(float64); !ok || (v != 100 && v != 515) {\n\t\terr = fmt.Errorf(\"wrong response: %s\", b)\n\t}\n\treturn\n}\n\nfunc SofiaHash(password string) string {\n\tconst chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"\n\n\tsofia := make([]byte, 0, 8)\n\thash := md5.Sum([]byte(password))\n\tfor i := 0; i < md5.Size; i += 2 {\n\t\tj := uint16(hash[i]) + uint16(hash[i+1])\n\t\tsofia = append(sofia, chars[j%62])\n\t}\n\n\treturn string(sofia)\n}\n","sourceCodeStart":213,"sourceCodeEnd":248,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/dvrip/client.go#L213-L248","documentation":"Raised in DVRIP ReadJSON when a JSON response parses successfully but its Ret status code is neither 100 (OK) nor 515 (also accepted success), meaning the camera rejected the command or returned an unexpected status; the raw payload is embedded for diagnosis.","triggerScenarios":"Thrown at pkg/dvrip/client.go:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the embedded payload to read the actual Ret code and nested error message","Verify credentials are logged in and not expired before issuing the command (Login again)","Confirm the command/parameters are supported by this camera firmware"],"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"}