{"record":{"id":"c0b21e5356d374cf","repo":"AlexxIT/go2rtc","slug":"failed-to-fetch-ring-devices-w","errorCode":null,"errorMessage":"failed to fetch ring devices: %w","messagePattern":"failed to fetch ring devices: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/ring/api.go","lineNumber":340,"sourceCode":"\tc.tokenExpiry = time.Now().Add(expiresIn)\n\n\tc.RefreshToken = encodeAuthConfig(c.authConfig)\n\tif c.onTokenRefresh != nil {\n\t\tc.onTokenRefresh(c.RefreshToken)\n\t}\n\n\t// Refresh the cached client\n\tcacheMutex.Lock()\n\tclientCache[c.cacheKey] = c\n\tcacheMutex.Unlock()\n\n\treturn c.authToken, nil\n}\n\nfunc (c *RingApi) FetchRingDevices() (*RingDevicesResponse, error) {\n\tresponse, err := c.Request(\"GET\", ClientAPI(\"ring_devices\"), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to fetch ring devices: %w\", err)\n\t}\n\n\tvar devices RingDevicesResponse\n\tif err := json.Unmarshal(response, &devices); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to unmarshal devices response: %w\", err)\n\t}\n\n\t// Process \"other\" devices\n\tvar onvifCameras []CameraData\n\tvar intercoms []CameraData\n\n\tfor _, device := range devices.Other {\n\t\tkind, ok := device[\"kind\"].(string)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch RingDeviceType(kind) {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/ring/api.go#L322-L358","documentation":"FetchRingDevices' GET ring_devices request (via c.Request) returned an error — typically an expired token or network/API failure. Wraps the underlying request error before any JSON parsing is attempted.","triggerScenarios":"Thrown at pkg/ring/api.go:340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify auth token validity and refresh if expired","Check network connectivity to the Ring API","Retry after transient failures"],"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"}