{"record":{"id":"e676dc1192073b90","repo":"clockworklabs/SpacetimeDB","slug":"failed-to-retrieve-current-directory","errorCode":null,"errorMessage":"Failed to retrieve current directory","messagePattern":"Failed to retrieve current directory","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/tasks/csharp.rs","lineNumber":505,"sourceCode":"                            \"{}{}{}\",\n                            \"  \".repeat(depth + 1),\n                            name,\n                            if path.is_dir() { \"/\" } else { \"\" }\n                        );\n                        if path.is_dir() {\n                            list_recursive(&path, depth + 1);\n                        }\n                    }\n                }\n            }\n            list_recursive(&bin_dir, 0);\n        }\n    }\n    anyhow::bail!(\"Built project successfully but couldn't find the output file.\");\n}\n\npub(crate) fn dotnet_format(project_dir: &Path, files: impl IntoIterator<Item = PathBuf>) -> anyhow::Result<()> {\n    let cwd = std::env::current_dir().expect(\"Failed to retrieve current directory\");\n    duct::cmd(\n        \"dotnet\",\n        itertools::chain(\n            [\n                \"format\",\n                // We can't guarantee that the output lives inside a valid project or solution,\n                // so to avoid crash we need to use the `dotnet whitespace --folder` mode instead\n                // of a full style-aware formatter. Still better than nothing though.\n                \"whitespace\",\n                \"--folder\",\n                project_dir.to_str().unwrap(),\n                // Our files are marked with <auto-generated /> and will be skipped without this option.\n                \"--include-generated\",\n                \"--include\",\n            ]\n            .into_iter()\n            .map_into::<OsString>(),\n            // Resolve absolute paths for all of the files, because we receive them as relative paths to cwd, but","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/tasks/csharp.rs#L487-L523","documentation":"Error \"Failed to retrieve current directory\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/cli/src/tasks/csharp.rs:505 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":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}