{"record":{"id":"47873e60dfc5e95b","repo":"Radarr/Radarr","slug":"freebox-api-returned-error-responsecontent-geter","errorCode":null,"errorMessage":"Freebox API returned error: {responseContent.GetErrorDescription()}","messagePattern":"Freebox API returned error: (.+?)","errorType":"exception","errorClass":"DownloadClientException","httpStatus":null,"severity":"error","filePath":"src/NzbDrone.Core/Download/Clients/FreeboxDownload/FreeboxDownloadProxy.cs","lineNumber":268,"sourceCode":"                throw new DownloadClientAuthenticationException(msg);\n            }\n            else if (response.StatusCode == HttpStatusCode.NotFound)\n            {\n                throw new FreeboxDownloadException(\"Unable to reach Freebox API. Verify 'API URL' setting for base URL and version.\");\n            }\n            else if (response.StatusCode == HttpStatusCode.OK)\n            {\n                var responseContent = Json.Deserialize<FreeboxResponse<T>>(response.Content);\n\n                if (responseContent.Success)\n                {\n                    return responseContent;\n                }\n                else\n                {\n                    var msg = $\"Freebox API returned error: {responseContent.GetErrorDescription()}\";\n                    _logger.Error(msg);\n                    throw new DownloadClientException(msg);\n                }\n            }\n            else\n            {\n                throw new DownloadClientException(\"Unable to connect to Freebox, please check your settings.\");\n            }\n        }\n    }\n}\n","sourceCodeStart":250,"sourceCodeEnd":278,"githubUrl":"https://github.com/Radarr/Radarr/blob/ca451608dc60c6cec754aba8d96bfa30e9468ed5/src/NzbDrone.Core/Download/Clients/FreeboxDownload/FreeboxDownloadProxy.cs#L250-L278","documentation":"Thrown when the Freebox API returns HTTP 200 OK but the JSON response body has Success == false. The Freebox API uses a two-layer protocol: HTTP status reflects transport success, while the JSON envelope's Success field reflects application-level success. This exception surfaces the Freebox error code/description from GetErrorDescription().","triggerScenarios":"ProcessRequest deserializes a FreeboxResponse<T> from a 200 response and responseContent.Success is false. Can occur on any API call: AddTaskFromUrl, AddTaskFromFile, DeleteTask, GetTasks, GetDownloadConfiguration, SetTorrentSettings.","commonSituations":"Adding a download with an invalid download_dir path, adding a duplicate task, the download URL is malformed or unreachable by the Freebox, disk full on the Freebox, or the requested operation conflicts with current task state (e.g., deleting a task that is mid-transfer).","solutions":["Read the GetErrorDescription() value in the exception message — it contains the Freebox-specific error code and text that pinpoints the problem.","For download_dir errors, verify the destination directory exists on the Freebox and matches an allowed download path.","For duplicate task errors, check whether the same torrent/NZB is already in the Freebox download queue.","For disk errors, check available storage on the Freebox.","Retry with corrected parameters based on the specific Freebox error description."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before adding a task, validate the download directory exists on the Freebox\n// (requires a prior successful GetDownloadConfiguration or filesystem check)\nif (string.IsNullOrWhiteSpace(directory))\n{\n    _logger.Warn(\"Download directory is empty; Freebox may reject the task.\");\n}","typeGuard":"static bool IsFreeboxApiBusinessError(Exception ex) => ex is DownloadClientException dce && dce.Message.Contains(\"Freebox API returned error\");","tryCatchPattern":"try\n{\n    _proxy.AddTaskFromUrl(url, directory, addPaused, addFirst, seedRatio, settings);\n}\ncatch (DownloadClientException ex) when (ex.Message.Contains(\"Freebox API returned error\"))\n{\n    // Parse the Freebox error description for specific handling\n    _logger.Error(ex, \"Freebox rejected the operation. Check error description for details.\");\n    // Optionally: re-throw as a user-facing message or retry with corrected params\n}\ncatch (DownloadClientException ex)\n{\n    _logger.Error(ex, \"Unexpected Freebox error.\");\n}","preventionTips":["Validate the download directory path against the Freebox's configured download directories before adding tasks.","Check for duplicate tasks before submitting — the Freebox will report an error for duplicates.","Ensure the Freebox has sufficient free disk space before large downloads.","Parse GetErrorDescription() output to surface actionable messages to the user."],"tags":["freebox","download-client","api-error","business-error"],"backgroundTag":null,"analyzedSha":"ca451608dc60c6cec754aba8d96bfa30e9468ed5","analyzedAt":"2026-08-13T17:21:54.115Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}