{"record":{"id":"ec8d9bfcadc2c38d","repo":"tsenart/vegeta","slug":"invalid-report-type-s","errorCode":null,"errorMessage":"invalid report type: %s","messagePattern":"invalid report type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"report.go","lineNumber":63,"sourceCode":"\tbuckets := fs.String(\"buckets\", \"\", \"Histogram buckets, e.g.: \\\"[0,1ms,10ms]\\\"\")\n\n\tfs.Usage = func() {\n\t\tfmt.Fprintf(os.Stderr, \"%s\\n\", reportUsage)\n\t}\n\n\treturn command{fs, func(args []string) error {\n\t\tfs.Parse(args)\n\t\tfiles := fs.Args()\n\t\tif len(files) == 0 {\n\t\t\tfiles = append(files, \"stdin\")\n\t\t}\n\t\treturn report(files, *typ, *output, *every, *buckets)\n\t}}\n}\n\nfunc report(files []string, typ, output string, every time.Duration, bucketsStr string) error {\n\tif len(typ) < 4 {\n\t\treturn fmt.Errorf(\"invalid report type: %s\", typ)\n\t}\n\n\tdec, mc, err := decoder(files)\n\tdefer mc.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tout, err := file(output, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer out.Close()\n\n\tvar (\n\t\trep    vegeta.Reporter\n\t\treport vegeta.Report\n\t)","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/tsenart/vegeta/blob/cf5811269046c672a604b1eb352204d30f16ae4a/report.go#L45-L81","documentation":"Returned by the `vegeta report` command when the -type flag value is shorter than 4 characters, i.e. not one of the recognized report types (text, json, histogram, plot). It's an early sanity check on the report type string.","triggerScenarios":"Running `vegeta report -type=xyz ...` (or a typo/empty value with length < 4), e.g. \"j\", \"htm\", \"\".","commonSituations":"Typos in the -type flag, shell variable defaults expanding to empty, older scripts using removed type names.","solutions":["Pass a valid type: text, json, histogram (or plot via the dedicated `vegeta plot` command).","Quote and verify the -type value in shell scripts to avoid empty expansion.","Run `vegeta report -h` to list supported types for your installed version.","Update scripts after vegeta upgrades; type names changed across versions (plot was removed from report)."],"exampleFix":"// before\nvegeta report -type=j results.bin\n// after\nvegeta report -type=json results.bin","handlingStrategy":"validation","validationCode":"var validTypes = map[string]bool{\"text\": true, \"json\": true, \"histogram\": true}\nfunc validateReportType(t string) error {\n    if !validTypes[t] {\n        return fmt.Errorf(\"-type must be one of text|json|histogram, got %q\", t)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := runReport(args); err != nil {\n    if strings.HasPrefix(err.Error(), \"invalid report type\") {\n        return fmt.Errorf(\"check -type flag: %w\", err)\n    }\n    return err\n}","preventionTips":["Validate the -type flag against known values before invoking.","Quote flag variables in shell to catch empty expansions.","Pin vegeta version and check `vegeta report -h` after upgrades."],"tags":["cli","configuration","report"],"backgroundTag":"invalid-argument-value","analyzedSha":"cf5811269046c672a604b1eb352204d30f16ae4a","analyzedAt":"2026-08-31T11:04:20.464Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}