{"record":{"id":"4a36f9230f73b4e6","repo":"TechnitiumSoftware/DnsServer","slug":"group-description-length-cannot-exceed-255-charact","errorCode":null,"errorMessage":"Group description length cannot exceed 255 characters.","messagePattern":"Group description length cannot exceed 255 characters\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"DnsServerCore/Auth/Group.cs","lineNumber":134,"sourceCode":"                    case \"dhcp administrators\":\n                        throw new InvalidOperationException(\"Access was denied.\");\n\n                    default:\n                        _name = value;\n                        break;\n                }\n            }\n        }\n\n        public string Description\n        {\n            get { return _description; }\n            set\n            {\n                if (string.IsNullOrWhiteSpace(value))\n                    _description = \"\";\n                else if (value.Length > 255)\n                    throw new ArgumentException(\"Group description length cannot exceed 255 characters.\", nameof(Description));\n                else\n                    _description = value;\n            }\n        }\n\n        #endregion\n    }\n}\n","sourceCodeStart":116,"sourceCodeEnd":143,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Auth/Group.cs#L116-L143","documentation":"Thrown by the Group.Description setter when a non-whitespace value longer than 255 characters is supplied. Whitespace-only values are normalized to empty string, so only a genuinely long description triggers it. It is an ArgumentException enforcing the configured storage width.","triggerScenarios":"Assigning Group.Description = text where text is longer than 255 chars (and not whitespace-only).","commonSituations":"Pasting a long help/policy document into the description field; a UI without a maxlength; a migration that maps a verbose legacy field into Description.","solutions":["Shorten the description to <= 255 characters.","Enforce a client-side maxlength and server-side validation on the description field.","Store longer prose in a separate notes/documentation attribute if available."],"exampleFix":"// before\ngroup.Description = description;\n\n// after\nif (!string.IsNullOrWhiteSpace(description) && description.Length > 255)\n    description = description.Substring(0, 255);\ngroup.Description = description;","handlingStrategy":"validation","validationCode":"if (!string.IsNullOrWhiteSpace(description) && description.Length > 255)\n    description = description.Substring(0, 255);\ngroup.Description = description;","typeGuard":null,"tryCatchPattern":"try { group.Description = description; }\ncatch (ArgumentException ex) when (ex.ParamName == \"Description\")\n{ return BadRequest(ex.Message); }","preventionTips":["Set a maxlength on the description input in the UI.","Trim or truncate long descriptions before assigning.","Validate length server-side."],"tags":["groups","validation","length-limit"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}