{"record":{"id":"c1134aeb1cabc8bf","repo":"iOfficeAI/OfficeCLI","slug":"invalid-propertyname-value-value-expected-c1134a","errorCode":null,"errorMessage":"Invalid '{propertyName}' value '{value}'. Expected an integer (0-255).","messagePattern":"Invalid '(.+?)' value '(.+?)'\\. Expected an integer \\(0-255\\)\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/ParseHelpers.cs","lineNumber":542,"sourceCode":"    }\n\n    /// <summary>\n    /// Safely parse a string as uint, throwing ArgumentException with a clear message on failure.\n    /// </summary>\n    public static uint SafeParseUint(string value, string propertyName)\n    {\n        if (!uint.TryParse(value, CultureInfo.InvariantCulture, out var result))\n            throw new ArgumentException($\"Invalid '{propertyName}' value '{value}'. Expected a non-negative integer.\");\n        return result;\n    }\n\n    /// <summary>\n    /// Safely parse a string as byte, throwing ArgumentException with a clear message on failure.\n    /// </summary>\n    public static byte SafeParseByte(string value, string propertyName)\n    {\n        if (!byte.TryParse(value, CultureInfo.InvariantCulture, out var result))\n            throw new ArgumentException($\"Invalid '{propertyName}' value '{value}'. Expected an integer (0-255).\");\n        return result;\n    }\n\n    /// <summary>\n    /// Normalize a hex color string to 8-char ARGB format (e.g. \"FFFF0000\").\n    /// Accepts: \"FF0000\" (6-char RGB → prepend FF), \"#FF0000\" (strip #), \"F00\" (3-char → expand),\n    /// \"80FF0000\" (8-char ARGB → as-is). Always returns uppercase.\n    /// </summary>\n    public static string NormalizeArgbColor(string value)\n    {\n        // CONSISTENCY(color-input-whitespace): outer trim BEFORE any\n        // hash-strip / hex inspection so \" #FF0000 \" / \" red \" / \"FF0000\\n\"\n        // (CLI pipes, JSON envelopes, copy-paste) parse the same as the bare\n        // value. Inner whitespace (\"#FF 0000\") remains invalid.\n        var trimmedInput = value.Trim();\n\n        // Try named color / rgb()/rgba()/hsl()/hsla() first\n        var resolved = TryResolveColorInput(trimmedInput);","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/ParseHelpers.cs#L524-L560","documentation":"Thrown by ParseHelpers.SafeParseByte when the value is not an integer in [0,255]. Culture-invariant parse; rejects negatives, values >255, decimals, and non-numeric text. Used for byte-sized properties such as chart series marker size.","triggerScenarios":"Passing series.markerSize / markersize with a value outside 0-255, a decimal, a negative, or non-numeric text. Callers: ChartHelper.SetterHelpers (series.markerSize) and ChartHelper.Setter (markersize).","commonSituations":"Passing a marker size derived from points/EMUs without clamping; passing '300' or '-1'; passing a percentage; confusing marker size with line width (which is a double).","solutions":["Clamp the marker size to the 0-255 integer range, e.g. markersize=\"10\".","Ensure the value is a whole number, not a decimal or a percent.","If you need a larger visual size, scale via the chart's overall size rather than the byte markerSize field."],"exampleFix":"// before\nseries.markerSize=\"300\"\n// after\nseries.markerSize=\"255\"","handlingStrategy":"validation","validationCode":"static bool IsByte(string value)\n    => byte.TryParse(value, System.Globalization.CultureInfo.InvariantCulture, out _);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp marker/byte sizes to 0-255 integers.","Do not pass decimals or percentages to byte fields.","Distinguish byte markerSize from double line width."],"tags":["parsing","input-validation","numeric","byte","chart","officecli"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}