{"record":{"id":"cd4b28b626161b07","repo":"GopeedLab/gopeed","slug":"eval-expects-inline-code-via-e-eval-or-a-script","errorCode":null,"errorMessage":"eval expects inline code via -e/--eval or a script file path","messagePattern":"eval expects inline code via -e/--eval or a script file path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/extmock/main.go","lineNumber":360,"sourceCode":"\tfs.StringVar(&script, \"eval\", \"\", \"Inline JavaScript to execute\")\n\tfs.StringVar(&cfg.provider, \"webview-provider\", \"\", \"WebView provider: go|rpc\")\n\tfs.StringVar(&cfg.network, \"webview-network\", \"\", \"WebView RPC network: unix|tcp\")\n\tfs.StringVar(&cfg.address, \"webview-address\", \"\", \"WebView RPC address\")\n\tfs.StringVar(&cfg.token, \"webview-token\", \"\", \"WebView RPC bearer token\")\n\tfs.BoolVar(&pretty, \"pretty\", false, \"Pretty-print JSON output\")\n\n\tflagArgs, positionalArgs, err := splitEvalArgs(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := fs.Parse(flagArgs); err != nil {\n\t\treturn err\n\t}\n\tif fs.NArg() != 0 {\n\t\treturn fmt.Errorf(\"unexpected trailing args: %v\", fs.Args())\n\t}\n\tif script == \"\" && len(positionalArgs) == 0 {\n\t\treturn fmt.Errorf(\"eval expects inline code via -e/--eval or a script file path\")\n\t}\n\tif script != \"\" && len(positionalArgs) > 0 {\n\t\treturn fmt.Errorf(\"eval accepts either inline code or a script file path, not both\")\n\t}\n\tif len(positionalArgs) > 1 {\n\t\treturn fmt.Errorf(\"eval expects at most 1 script file path\")\n\t}\n\n\td, cleanup, err := newExtMockDownloader(cfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer cleanup()\n\n\truntime, err := d.NewExtensionEngine(newExtMockExtension(), map[string]any{})\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/GopeedLab/gopeed/blob/7b7327ffb30816273a74b142cccc0bc10c5a4c67/cmd/extmock/main.go#L342-L378","documentation":"Error \"eval expects inline code via -e/--eval or a script file path\" thrown in GopeedLab/gopeed.","triggerScenarios":"Thrown at cmd/extmock/main.go:360 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b7327ffb30816273a74b142cccc0bc10c5a4c67","analyzedAt":"2026-08-16T02:51:03.250Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}