{"record":{"id":"3826ebee0fcc4feb","repo":"Devolutions/UniGetUI","slug":"the-manager-parameter-is-required","errorCode":null,"errorMessage":"The manager parameter is required.","messagePattern":"The manager parameter is required\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcManagerSettingsApi.cs","lineNumber":354,"sourceCode":"            .ToArray();\n\n        if (managers.Length == 0)\n        {\n            throw new InvalidOperationException(\n                string.IsNullOrWhiteSpace(managerName)\n                    ? \"No package managers are available.\"\n                    : $\"No package manager matching \\\"{managerName}\\\" was found.\"\n            );\n        }\n\n        return managers;\n    }\n\n    internal static IPackageManager ResolveManager(string managerName)\n    {\n        if (string.IsNullOrWhiteSpace(managerName))\n        {\n            throw new InvalidOperationException(\"The manager parameter is required.\");\n        }\n\n        return ResolveManagers(managerName).First();\n    }\n\n    internal static bool MatchesManagerId(IPackageManager manager, string? managerName)\n    {\n        return string.IsNullOrWhiteSpace(managerName)\n            || manager.Id.Equals(managerName, StringComparison.OrdinalIgnoreCase);\n    }\n\n    internal static string GetPublicManagerId(IPackageManager manager)\n    {\n        return manager.Id;\n    }\n\n    internal static string GetPublicManagerId(string? managerName)\n    {","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcManagerSettingsApi.cs#L336-L372","documentation":"Thrown by ResolveManager (singular) when managerName is null, empty, or whitespace. Unlike ResolveManagers (plural) which accepts null as 'match all', ResolveManager requires a specific manager because it returns exactly one IPackageManager via .First().","triggerScenarios":"Calling GetMaintenanceInfo(null), AddSourceAsync/RemoveSourceAsync with an empty ManagerName, SetManagerEnabledAsync/SetManagerNotifications with empty ManagerName, or any API that calls ResolveManager with a null/whitespace argument.","commonSituations":"IPC client omits the managerName field from the JSON payload (defaults to empty string via DTO initialization). Form validation missing on the client side. Using the plural ResolveManagers API where null means 'all' and accidentally routing to the singular resolver.","solutions":["Provide a non-empty manager name (preferably the manager Id) to the request.","Call ListManagers() to get valid manager Ids before calling single-manager APIs.","Add client-side validation that managerName is not blank before sending the IPC request."],"exampleFix":"// before\nvar info = IpcManagerMaintenanceApi.GetMaintenanceInfo(\"\");\n// after\nvar managers = IpcManagerSettingsApi.ListManagers();\nif (managers.Count == 0) throw new InvalidOperationException(\"No managers.\");\nvar info = IpcManagerMaintenanceApi.GetMaintenanceInfo(managers[0].Name);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(managerName))\n    throw new ArgumentException(\"Manager name is required.\", nameof(managerName));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always validate managerName is non-blank before calling single-manager APIs.","Remember ResolveManager (singular) requires a name, while ResolveManagers (plural) accepts null.","Populate ManagerName on request DTOs explicitly — they default to empty string."],"tags":["package-manager","ipc","validation","required-field"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}