{"record":{"id":"e2cdaacd6e5d8344","repo":"multica-ai/multica","slug":"read-custom-env-file-w","errorCode":null,"errorMessage":"read --custom-env-file: %w","messagePattern":"read --custom-env-file: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_agent.go","lineNumber":1286,"sourceCode":"\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)\n\t\t}\n\t}\n\n\tce, err := parseCustomEnv(raw)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\treturn ce, true, nil\n}\n\n// parseMcpConfig validates the --mcp-config value and returns the raw JSON to\n// send. It accepts a JSON object (the MCP config, e.g. {\"mcpServers\": {…}}) or\n// the literal `null` to clear the agent's config.\nfunc parseMcpConfig(raw string) (json.RawMessage, error) {","sourceCodeStart":1268,"sourceCodeEnd":1304,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_agent.go#L1268-L1304","documentation":"Error \"read --custom-env-file: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_agent.go:1286 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the file exists and is readable."],"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-15T17:31:12.345Z"}