{"record":{"id":"77665f668957ef03","repo":"bevyengine/bevy","slug":"not-empty","errorCode":null,"errorMessage":"not empty","messagePattern":"not empty","errorType":"exception","errorClass":"AssetWriterError::Io","httpStatus":null,"severity":"error","filePath":"crates/bevy_asset/src/io/memory.rs","lineNumber":588,"sourceCode":"            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(\n                ErrorKind::DirectoryNotEmpty,\n                \"not empty\",\n            )));\n        }\n\n        self.root.remove_dir(path);\n        Ok(())\n    }\n\n    async fn remove_assets_in_directory<'a>(\n        &'a self,\n        path: &'a Path,\n    ) -> 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            )));","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_asset/src/io/memory.rs#L570-L606","documentation":"Returned by the memory writer's remove_empty_directory when the directory exists but still contains assets, metadata, or subdirectories. Modeled on filesystem behavior where rmdir fails on non-empty directories, the caller must empty the directory first.","triggerScenarios":"Thrown at crates/bevy_asset/src/io/memory.rs:588 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove all contained assets, meta files, and subdirectories before calling remove_empty_directory","Use the non-empty-tolerant remove_directory instead if recursive deletion is intended","Check the directory's contents first if emptiness is not guaranteed"],"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-14T00:17:10.932Z"}