{"record":{"id":"d20fa1c9dec17f09","repo":"bevyengine/bevy","slug":"no-such-dir","errorCode":null,"errorMessage":"no such dir","messagePattern":"no such dir","errorType":"exception","errorClass":"AssetWriterError::Io","httpStatus":null,"severity":"error","filePath":"crates/bevy_asset/src/io/memory.rs","lineNumber":570,"sourceCode":"        };\n        self.root.insert_meta(new_path, old_meta.value);\n        // Remove the meta after instead of before since otherwise there'd be a moment where the\n        // Dir is unlocked and missing both the old and new paths. This just prevents race\n        // conditions.\n        self.root.remove_metadata(old_path);\n        Ok(())\n    }\n\n    async fn create_directory<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {\n        // Just pretend we're on a file system that doesn't consider directory re-creation a\n        // failure.\n        self.root.get_or_insert_dir(path);\n        Ok(())\n    }\n\n    async fn remove_directory<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {\n        if self.root.remove_dir(path).is_none() {\n            return Err(AssetWriterError::Io(Error::new(\n                ErrorKind::NotFound,\n                \"no such dir\",\n            )));\n        }\n        Ok(())\n    }\n\n    async fn remove_empty_directory<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {\n        let Some(dir) = self.root.get_dir(path) else {\n            return Err(AssetWriterError::Io(Error::new(\n                ErrorKind::NotFound,\n                \"no such dir\",\n            )));\n        };\n\n        let dir = dir.0.read().unwrap();\n        if !dir.assets.is_empty() || !dir.metadata.is_empty() || !dir.dirs.is_empty() {\n            return Err(AssetWriterError::Io(Error::new(","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_asset/src/io/memory.rs#L552-L588","documentation":"AssetWriterError::Io with ErrorKind::NotFound and message 'no such dir', returned by the memory writer's remove_directory when the target directory does not exist in the in-memory asset hierarchy. Like a real filesystem, deleting a missing directory is an error.","triggerScenarios":"Thrown at crates/bevy_asset/src/io/memory.rs:570 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the directory path exists in the memory source before removing it","Create the directory first if your flow requires remove-then-recreate","Ignore/handle NotFound when the directory's absence is an acceptable end state"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}