{"record":{"id":"42340b3863321491","repo":"Devolutions/UniGetUI","slug":"the-value-supplied-to-argumentname-must-be-an-in","errorCode":null,"errorMessage":"The value supplied to {argumentName} must be an integer.","messagePattern":"The value supplied to (.+?) must be an integer\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcCliCommandRunner.cs","lineNumber":794,"sourceCode":"    }\n\n    private static int? GetOptionalIntArgument(\n        IReadOnlyList<string> arguments,\n        string argumentName\n    )\n    {\n        string? value = GetOptionalArgument(arguments, argumentName);\n        if (value is null)\n        {\n            return null;\n        }\n\n        if (int.TryParse(value, out int result))\n        {\n            return result;\n        }\n\n        throw new InvalidOperationException(\n            $\"The value supplied to {argumentName} must be an integer.\"\n        );\n    }\n\n    private static bool? GetOptionalBoolArgument(\n        IReadOnlyList<string> arguments,\n        string argumentName\n    )\n    {\n        string? value = GetOptionalArgument(arguments, argumentName);\n        if (value is null)\n        {\n            return null;\n        }\n\n        if (bool.TryParse(value, out bool result))\n        {\n            return result;","sourceCodeStart":776,"sourceCodeEnd":812,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcCliCommandRunner.cs#L776-L812","documentation":"Thrown by GetOptionalIntArgument when an argument that is present on the command line cannot be parsed as an Int32 by int.TryParse (culture-invariant, integer only). This helper backs any CLI integer flag (e.g. timeouts, line counts) so the offending argument name is interpolated into the message.","triggerScenarios":"Passing a non-numeric or out-of-int-range value to an integer CLI flag, e.g. '--tail-lines abc', '--tail-lines 99999999999' (overflow), or '--tail-lines 1.5'. The argument is found by GetOptionalArgument and then int.TryParse fails.","commonSituations":"Passing a float where an int is expected. Exceeding Int32.MaxValue for a count. A unit suffix like '--tail-lines 100k'. Locale decimal separators.","solutions":["Supply a plain integer within Int32 range, e.g. '--tail-lines 100'.","Remove any unit suffixes or thousands separators.","Check the command's help to confirm the flag expects an integer."],"exampleFix":"// before\nunigetui operation output --id abc123 --tail-lines 1.5k\n// after\nunigetui operation output --id abc123 --tail-lines 1500","handlingStrategy":"validation","validationCode":"static bool TryNormalizeInt(string? raw, out int value) =>\n    int.TryParse(raw, NumberStyles.Integer, CultureInfo.InvariantCulture, out value);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use numeric input controls clamped to Int32 range for integer flags.","Reject unit suffixes and separators client-side."],"tags":["ipc","cli","input-validation","integer","parsing"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}