{"record":{"id":"a208f5831e8f2994","repo":"BornToBeRoot/NETworkManager","slug":"group-name-not-found","errorCode":null,"errorMessage":"Group '{name}' not found.","messagePattern":"Group '(.+?)' not found\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Source/NETworkManager.Profiles/ProfileManager.cs","lineNumber":1145,"sourceCode":"        ProfilesUpdated(profilesChanged);\n    }\n\n    /// <summary>\n    ///     Method to get a group by name.\n    /// </summary>\n    /// <param name=\"name\">Name of the group.</param>\n    /// <returns>Group as <see cref=\"GroupInfo\" />.</returns>\n    /// <exception cref=\"ArgumentException\">Thrown when name is null or empty.</exception>\n    /// <exception cref=\"InvalidOperationException\">Thrown when group with specified name is not found.</exception>\n    public static GroupInfo GetGroupByName(string name)\n    {\n        ArgumentException.ThrowIfNullOrWhiteSpace(name);\n\n\n        var group = LoadedProfileFileData.Groups.FirstOrDefault(x => x.Name.Equals(name));\n\n        if (group == null)\n            throw new InvalidOperationException($\"Group '{name}' not found.\");\n\n        return group;\n    }\n\n    /// <summary>\n    ///     Method to replace a group.\n    /// </summary>\n    /// <param name=\"oldGroup\">Old group as <see cref=\"GroupInfo\" />.</param>\n    /// <param name=\"newGroup\">New group as <see cref=\"GroupInfo\" />.</param>\n    /// <exception cref=\"ArgumentNullException\">Thrown when oldGroup or newGroup is null.</exception>\n    public static void ReplaceGroup(GroupInfo oldGroup, GroupInfo newGroup)\n    {\n        ArgumentNullException.ThrowIfNull(oldGroup);\n        ArgumentNullException.ThrowIfNull(newGroup);\n\n        LoadedProfileFileData.Groups.Remove(oldGroup);\n        LoadedProfileFileData.Groups.Add(newGroup);\n","sourceCodeStart":1127,"sourceCodeEnd":1163,"githubUrl":"https://github.com/BornToBeRoot/NETworkManager/blob/2780d65469917a296dbc15f206107d72e2d0115c/Source/NETworkManager.Profiles/ProfileManager.cs#L1127-L1163","documentation":"GetGroupByName looked up LoadedProfileFileData.Groups for a group whose Name equals the requested name and found no match, so it throws InvalidOperationException after the initial ArgumentException guard on null/empty name. It signals that the caller referenced a group (e.g. as a profile's Group value) that does not exist in the currently loaded profile file — a sentinel lookup failure, not a file I/O problem.","triggerScenarios":"Thrown at Source/NETworkManager.Profiles/ProfileManager.cs:1145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call GroupExists(name) before GetGroupByName to verify the group is present.","Check for exact-name mismatches: trailing whitespace or case differences in the group name.","Create the missing group with AddGroup before referencing it.","Refresh/reload the profile file if the group was added by another component and is not yet in the loaded data."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2780d65469917a296dbc15f206107d72e2d0115c","analyzedAt":"2026-09-12T17:00:17.986Z","contentChangedAt":"2026-09-12T17:00:17.986Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}