{"record":{"id":"c66bbcb3c80b1cd7","repo":"multica-ai/multica","slug":"read-custom-env-stdin-w","errorCode":null,"errorMessage":"read --custom-env-stdin: %w","messagePattern":"read --custom-env-stdin: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1272,"sourceCode":"\t}\n\tif fromFile {\n\t\tcount++\n\t}\n\tswitch {\n\tcase count == 0:\n\t\treturn nil, false, nil\n\tcase count > 1:\n\t\treturn nil, false, fmt.Errorf(\"--custom-env, --custom-env-stdin, and --custom-env-file are mutually exclusive; pick one\")\n\t}\n\n\tvar raw string\n\tswitch {\n\tcase inline:\n\t\traw, _ = cmd.Flags().GetString(\"custom-env\")\n\tcase fromStdin:\n\t\tbuf, err := io.ReadAll(cmd.InOrStdin())\n\t\tif err != nil {\n\t\t\treturn nil, false, fmt.Errorf(\"read --custom-env-stdin: %w\", err)\n\t\t}\n\t\traw = string(buf)\n\t\tif strings.TrimSpace(raw) == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--custom-env-stdin: empty input; pass '{}' to clear\")\n\t\t}\n\tcase fromFile:\n\t\tif filePath == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--custom-env-file: path must not be empty\")\n\t\t}\n\t\tbuf, err := os.ReadFile(filePath)\n\t\tif err != nil {\n\t\t\t// Filesystem errors may include the path but not the contents —\n\t\t\t// safe to surface via %w.\n\t\t\treturn nil, false, fmt.Errorf(\"read --custom-env-file: %w\", err)\n\t\t}\n\t\traw = string(buf)\n\t\tif strings.TrimSpace(raw) == \"\" {\n\t\t\treturn nil, false, fmt.Errorf(\"--custom-env-file %q: empty contents; pass '{}' to clear\", filePath)","sourceCodeStart":1254,"sourceCodeEnd":1290,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1254-L1290","documentation":"Error \"read --custom-env-stdin: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_agent.go:1272 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the stdin input so it can be read (check the piped command)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}