{"record":{"id":"4b88aabd16c6edcb","repo":"iOfficeAI/OfficeCLI","slug":"invalid-border-style-value-valid-values-thi","errorCode":null,"errorMessage":"Invalid border style: '{value}'. Valid values: thin, medium, thick, double, dashed, dotted, dashdot, dashdotdot, hair, mediumdashed, mediumdashdot, mediumdashdotdot, slantdashdot, none.","messagePattern":"Invalid border style: '(.+?)'\\. Valid values: thin, medium, thick, double, dashed, dotted, dashdot, dashdotdot, hair, mediumdashed, mediumdashdot, mediumdashdotdot, slantdashdot, none\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/ExcelStyleManager.cs","lineNumber":1636,"sourceCode":"\n    private static BorderStyleValues ParseBorderStyle(string value) =>\n        value.ToLowerInvariant() switch\n        {\n            \"thin\" => BorderStyleValues.Thin,\n            \"medium\" => BorderStyleValues.Medium,\n            \"thick\" => BorderStyleValues.Thick,\n            \"double\" => BorderStyleValues.Double,\n            \"dashed\" => BorderStyleValues.Dashed,\n            \"dotted\" => BorderStyleValues.Dotted,\n            \"dashdot\" => BorderStyleValues.DashDot,\n            \"dashdotdot\" => BorderStyleValues.DashDotDot,\n            \"hair\" => BorderStyleValues.Hair,\n            \"mediumdashed\" => BorderStyleValues.MediumDashed,\n            \"mediumdashdot\" => BorderStyleValues.MediumDashDot,\n            \"mediumdashdotdot\" => BorderStyleValues.MediumDashDotDot,\n            \"slantdashdot\" => BorderStyleValues.SlantDashDot,\n            \"none\" => BorderStyleValues.None,\n            _ => throw new ArgumentException($\"Invalid border style: '{value}'. Valid values: thin, medium, thick, double, dashed, dotted, dashdot, dashdotdot, hair, mediumdashed, mediumdashdot, mediumdashdotdot, slantdashdot, none.\"),\n        };\n\n    // ==================== CellFormat ====================\n\n    private static uint FindOrCreateCellFormat(CellFormats cellFormats,\n        uint numFmtId, uint fontId, uint fillId, uint borderId, Alignment? alignment, Protection? protection,\n        bool applyNumFmt, bool applyFont, bool applyFill, bool applyBorder, bool applyAlignment, bool applyProtection,\n        bool? quotePrefix = null)\n    {\n        // Search for existing match\n        int idx = 0;\n        foreach (var xf in cellFormats.Elements<CellFormat>())\n        {\n            if ((xf.NumberFormatId?.Value ?? 0) == numFmtId &&\n                (xf.FontId?.Value ?? 0) == fontId &&\n                (xf.FillId?.Value ?? 0) == fillId &&\n                (xf.BorderId?.Value ?? 0) == borderId &&\n                AlignmentMatches(xf.Alignment, alignment) &&","sourceCodeStart":1618,"sourceCodeEnd":1654,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/ExcelStyleManager.cs#L1618-L1654","documentation":"Thrown by the Excel border-style parser when a border style string does not match any of the recognized ECMA-376 border style tokens. The switch maps lowercase names to BorderStylesValues; the default arm rejects unknown values with the full list of valid options.","triggerScenarios":"Passing a border= or borderSide= property with a value not in {thin, medium, thick, double, dashed, dotted, dashdot, dashdotdot, hair, mediumdashed, mediumdashdot, mediumdashdotdot, slantdashdot, none}. Matching is case-insensitive (the input is lowercased).","commonSituations":"Typo like 'doted' or 'meduim'; using a CSS name like 'ridge'/'groove' not supported in Excel; trailing whitespace not trimmed.","solutions":["Use one of the listed valid border style names, spelled exactly.","Trim whitespace and lowercase the value before passing it.","Map your app's border vocabulary to the supported Excel set."],"exampleFix":"// before\nborder[\"bottom\"] = \"meduim\"; // typo\n// after\nborder[\"bottom\"] = \"medium\";","handlingStrategy":"type-guard","validationCode":"static readonly HashSet<string> ValidBorders = new(StringComparer.OrdinalIgnoreCase)\n{ \"thin\",\"medium\",\"thick\",\"double\",\"dashed\",\"dotted\",\"dashdot\",\"dashdotdot\",\"hair\",\"mediumdashed\",\"mediumdashdot\",\"mediumdashdotdot\",\"slantdashdot\",\"none\" };\nstatic string NormalizeBorder(string v) => ValidBorders.Contains(v?.Trim() ?? \"\") ? v.Trim().ToLowerInvariant() : throw new ArgumentException(\"invalid border\");","typeGuard":"static bool IsValidBorderStyle(string v) => ValidBorders.Contains(v?.Trim() ?? \"\");","tryCatchPattern":"try { SetBorder(value); }\ncatch (ArgumentException ex) when (ex.Message.StartsWith(\"Invalid border style\"))\n{ /* default to 'none' or prompt */ }","preventionTips":["Trim and lowercase border values before passing.","Restrict the UI/config vocabulary to the supported set."],"tags":["excel","border","validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}