{"record":{"id":"34292c9f8d606718","repo":"iOfficeAI/OfficeCLI","slug":"unknown-errorstyle-dverrstyle-use-stop-warni","errorCode":null,"errorMessage":"Unknown errorStyle: {dvErrStyle}. Use: stop, warning, information","messagePattern":"Unknown errorStyle: (.+?)\\. Use: stop, warning, information","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Handlers/Excel/ExcelHandler.Add.Tables.cs","lineNumber":656,"sourceCode":"\n        if (properties.TryGetValue(\"errorTitle\", out var dvErrorTitle))\n            dv.ErrorTitle = dvErrorTitle;\n        if (properties.TryGetValue(\"error\", out var dvError))\n            dv.Error = dvError;\n        if (properties.TryGetValue(\"promptTitle\", out var dvPromptTitle))\n            dv.PromptTitle = dvPromptTitle;\n        if (properties.TryGetValue(\"prompt\", out var dvPrompt))\n            dv.Prompt = dvPrompt;\n\n        // V6 — errorStyle: stop (default), warning, information.\n        if (properties.TryGetValue(\"errorStyle\", out var dvErrStyle))\n        {\n            dv.ErrorStyle = dvErrStyle.ToLowerInvariant() switch\n            {\n                \"stop\" => DataValidationErrorStyleValues.Stop,\n                \"warning\" or \"warn\" => DataValidationErrorStyleValues.Warning,\n                \"information\" or \"info\" => DataValidationErrorStyleValues.Information,\n                _ => throw new ArgumentException(\n                    $\"Unknown errorStyle: {dvErrStyle}. Use: stop, warning, information\")\n            };\n        }\n\n        // V7 — showDropDown / inCellDropdown. OOXML `showDropDown`\n        // has INVERTED semantics: true = HIDE the in-cell arrow.\n        // Expose it as `inCellDropdown` (user-friendly sense) and\n        // the raw `showDropDown` (OOXML sense).\n        if (properties.TryGetValue(\"inCellDropdown\", out var dvInCell))\n            dv.ShowDropDown = !ParseHelpers.IsTruthy(dvInCell);\n        else if (properties.TryGetValue(\"showDropDown\", out var dvShowDd))\n            dv.ShowDropDown = ParseHelpers.IsTruthy(dvShowDd);\n\n        var wsEl = GetSheet(dvWorksheet);\n        var dvs = wsEl.GetFirstChild<DataValidations>();\n        // R27-3: stacking a second DV on a sqref that overlaps an existing\n        // DV is silently invisible in Excel (first wins). Reject up-front\n        // rather than persist a useless rule.","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Handlers/Excel/ExcelHandler.Add.Tables.cs#L638-L674","documentation":"Thrown by AddValidation when the optional \"errorStyle\" property is present but its lower-cased value is not stop, warning (or warn), or information (or info). These map to DataValidationErrorStyleValues; an unrecognized style is rejected rather than silently defaulting to stop.","triggerScenarios":"Call Add type \"validation\" with properties[\"errorStyle\"] set to an out-of-set value (e.g. \"critical\", \"error\", \"mandatory\", \"hard\").","commonSituations":"Using the Excel-UI word 'Stop' as something else; expecting 'error' as a synonym for 'stop'; typos; mixing alert-style vocabulary from another library.","solutions":["Use one of: stop, warning, information (warn/info aliases accepted).","Omit errorStyle entirely to keep the Excel default (stop).","Validate the value against the allowed set before calling."],"exampleFix":"// before\nhandler.Add(\"/Sheet1\", \"validation\", null,\n    new() { [\"sqref\"] = \"A1:A5\", [\"type\"] = \"whole\", [\"errorStyle\"] = \"critical\" });\n// after\nhandler.Add(\"/Sheet1\", \"validation\", null,\n    new() { [\"sqref\"] = \"A1:A5\", [\"type\"] = \"whole\", [\"errorStyle\"] = \"stop\" });","handlingStrategy":"type-guard","validationCode":"static readonly HashSet<string> ErrStyles = new(StringComparer.OrdinalIgnoreCase)\n    { \"stop\", \"warning\", \"warn\", \"information\", \"info\" };\nif (properties.TryGetValue(\"errorStyle\", out var es) && !ErrStyles.Contains(es))\n    throw new ArgumentOutOfRangeException($\"bad errorStyle '{es}'\");","typeGuard":"static bool IsValidErrorStyle(string? es) =>\n    es is not null && (new[] { \"stop\", \"warning\", \"warn\", \"information\", \"info\" })\n        .Contains(es, StringComparer.OrdinalIgnoreCase);","tryCatchPattern":null,"preventionTips":["Omit errorStyle to keep the default (stop).","Do not invent synonyms like 'critical' or 'error'.","Lower-case and strip whitespace before validating."],"tags":["excel","validation","enum","error-style"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}