{"record":{"id":"e263746e0a26bbe5","repo":"chenhg5/cc-connect","slug":"invalid-max-bytes-q","errorCode":null,"errorMessage":"invalid --max-bytes %q","messagePattern":"invalid --max-bytes %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/tuitui.go","lineNumber":338,"sourceCode":"\t\tcase \"--url\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\topts.url = v\n\t\tcase \"--out\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\topts.outDir = v\n\t\tcase \"--max-bytes\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\tif _, err := fmt.Sscanf(v, \"%d\", &opts.maxBytes); err != nil {\n\t\t\t\treturn opts, fmt.Errorf(\"invalid --max-bytes %q\", v)\n\t\t\t}\n\t\tcase \"--channel\", \"--channel-id\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\topts.channelID = v\n\t\tcase \"--parent\", \"--parent-id\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\topts.parentID = v\n\t\tcase \"--message\", \"-m\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/tuitui.go#L320-L356","documentation":"--max-bytes must parse as an integer via fmt.Sscanf(\"%d\"); a non-numeric value triggers this error in parseTuiTuiArgs. The parsed value bounds downloadTuiTuiURL's download size check (errors 441/442).","triggerScenarios":"`--max-bytes 25MB`, `--max-bytes 1e6`, or any non-integer token passed to the tuitui download/post/messages subcommands.","commonSituations":"Human-readable sizes like \"10MB\" used instead of raw bytes; scientific notation; stray units.","solutions":["Use raw byte count: --max-bytes 26214400","Convert MB to bytes (25MiB = 26214400)","Omit the flag to use the built-in 25MiB default"],"exampleFix":"// before\ncc-connect tuitui download --url ... --max-bytes 50MB\n// after\ncc-connect tuitui download --url ... --max-bytes 52428800","handlingStrategy":"validation","validationCode":"if n, err := strconv.Atoi(v); err != nil || n <= 0 {\n\treturn fmt.Errorf(\"invalid --max-bytes %q (want integer bytes)\", v)\n}","typeGuard":null,"tryCatchPattern":"if _, err := parseTuiTuiArgs(args); err != nil {\n\tif strings.HasPrefix(err.Error(), \"invalid --max-bytes\") {\n\t\tfmt.Fprintf(os.Stderr, \"--max-bytes takes raw bytes, e.g. 26214400\\n\")\n\t}\n}","preventionTips":["Convert MB/GB to raw bytes before passing","Omit the flag to use the 25MiB default","Use strict strconv parsing in scripts that build the command"],"tags":["cli","flag","validation"],"backgroundTag":"invalid-flag-value","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}