{"record":{"id":"0c7229347c25f0da","repo":"sxyazi/yazi","slug":"item-is-not-in-the-trash","errorCode":null,"errorMessage":"item is not in the trash","messagePattern":"item is not in the trash","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/trash/macos/trash.rs","lineNumber":50,"sourceCode":"\t\tit.map(|dent| {\n\t\t\tlet dent = dent?;\n\t\t\tif let Some(entry) = entry {\n\t\t\t\tentry.child(dent.file_name())\n\t\t\t} else {\n\t\t\t\tlet path = dent.path();\n\t\t\t\tlet original = store\n\t\t\t\t\t.get(path.file_name().unwrap_or_default())\n\t\t\t\t\t.and_then(|ds| ds.join(Path::new(\"\")).ok());\n\t\t\t\tTrashEntry::top(path.clone(), path, original)\n\t\t\t}\n\t\t})\n\t\t.collect()\n\t}\n\n\tpub(crate) fn entry(&self, id: &TrashId) -> io::Result<TrashEntry> {\n\t\tlet root = self.root()?;\n\t\tif id.top().parent() != Some(&root) {\n\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidInput, \"item is not in the trash\"));\n\t\t}\n\t\tif id.has_rel() && !fs::symlink_metadata(id.top())?.file_type().is_dir() {\n\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidInput, \"trash item is not a directory\"));\n\t\t}\n\n\t\tlet store = DsStore::parse(&root.join(\".DS_Store\")).unwrap_or_default();\n\t\tlet name = id.top().file_name().unwrap_or_default();\n\t\tlet original = store.get(name).and_then(|ds| ds.join(id.rel()).ok());\n\n\t\tTrashEntry::new(id.clone(), id.path(), original)\n\t}\n\n\tpub(crate) fn metadata(&self, entry: &TrashEntry, follow: bool) -> io::Result<Cha> {\n\t\tOk(if follow { entry.cha } else { entry.lcha })\n\t}\n\n\tpub(crate) fn revalidate(\n\t\t&self,","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/sxyazi/yazi/blob/8ebf930f1796ae2076b7d6b0c5e93a1002c18134/yazi-fs/src/trash/macos/trash.rs#L32-L68","documentation":"Error \"item is not in the trash\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-fs/src/trash/macos/trash.rs:50 when the library encounters an invalid state.","commonSituations":"Operating on a macOS trash item whose path is not actually located inside ~/.Trash.","solutions":["The item is not inside ~/.Trash; only items in the trash can be restored or purged."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8ebf930f1796ae2076b7d6b0c5e93a1002c18134","analyzedAt":"2026-08-19T05:27:26.468Z","contentChangedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}