{"record":{"id":"ac50aa742df0dc3e","repo":"antonmedv/fx","slug":"get-cwd-w","errorCode":null,"errorMessage":"get cwd: %w","messagePattern":"get cwd: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/engine/fxrc.go","lineNumber":16,"sourceCode":"package engine\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nfunc readFxrc() (string, error) {\n\tvar builder strings.Builder\n\n\t// Determine search paths\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get cwd: %w\", err)\n\t}\n\tpaths := []string{filepath.Join(cwd, \".fxrc.js\")}\n\n\thome, err := os.UserHomeDir()\n\tif err == nil {\n\t\tpaths = append(paths, filepath.Join(home, \".fxrc.js\"))\n\t}\n\n\txdgHome := os.Getenv(\"XDG_CONFIG_HOME\")\n\tif xdgHome == \"\" && home != \"\" {\n\t\txdgHome = filepath.Join(home, \".config\")\n\t}\n\tif xdgHome != \"\" {\n\t\tpaths = append(paths, filepath.Join(xdgHome, \"fx\", \".fxrc.js\"))\n\t}\n\n\txdgDirs := os.Getenv(\"XDG_CONFIG_DIRS\")\n\tif xdgDirs == \"\" {","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/antonmedv/fx/blob/4f31cd3a0c5d66f1b4290a2719bab14a5cee8ebe/internal/engine/fxrc.go#L1-L34","documentation":"Wraps a failure of os.Getwd() while readFxrc builds its list of .fxrc.js search paths. The current working directory cannot be determined (e.g. the directory was deleted or the process lacks permission to stat it), so the cwd-based config path cannot be computed and config loading aborts.","triggerScenarios":"Thrown at internal/engine/fxrc.go:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["cd back into a valid directory before running fx","Restore or recreate the deleted working directory","Check filesystem/mount health if Getwd fails persistently"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4f31cd3a0c5d66f1b4290a2719bab14a5cee8ebe","analyzedAt":"2026-09-02T02:17:47.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}