{"record":{"id":"1f77e4c834ee44fb","repo":"sxyazi/yazi","slug":"notfound-1f77e4","errorCode":"NotFound","errorMessage":"trash item has no put-back location","messagePattern":"trash item has no put-back location","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/trash/windows/trash.rs","lineNumber":32,"sourceCode":"\nimpl Trash {\n\tpub(crate) fn new() -> io::Result<Self> {\n\t\tCOM.with(|result| {\n\t\t\tresult.as_ref().map(|_| Self).map_err(|e| io::Error::new(e.kind(), e.to_string()))\n\t\t})\n\t}\n\n\tpub(crate) fn list(&self, entry: Option<&TrashEntry>) -> io::Result<Vec<TrashEntry>> {\n\t\tlet Some(entry) = entry else {\n\t\t\treturn self.tops();\n\t\t};\n\n\t\tif !entry.lcha.is_dir() || entry.lcha.is_indirect() {\n\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidInput, \"trash item is not a directory\"));\n\t\t}\n\n\t\tlet original = entry.original.as_deref().ok_or_else(|| {\n\t\t\tio::Error::new(io::ErrorKind::NotFound, \"trash item has no put-back location\")\n\t\t})?;\n\n\t\tself\n\t\t\t.resolve(entry)?\n\t\t\t.children()?\n\t\t\t.into_iter()\n\t\t\t.map(|item| {\n\t\t\t\tlet name = item.display_name(SIGDN_PARENTRELATIVEPARSING)?;\n\t\t\t\titem.entry(entry.id.child(&name)?, Some(original.join(&name)))\n\t\t\t})\n\t\t\t.collect()\n\t}\n\n\tpub(crate) fn entry(&self, id: &TrashId) -> io::Result<TrashEntry> {\n\t\tlet top = ShellItem::top(id.top())?;\n\t\tlet original = top.original()?;\n\t\tif !id.has_rel() {\n\t\t\treturn top.entry(id.clone(), Some(original));","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-fs/src/trash/windows/trash.rs#L14-L50","documentation":"When listing children of a trashed directory on Windows, the entry must know its original (put-back) path to compute the mapping. This error is raised when `entry.original` is None — the trash entry has no recorded original location, so its children cannot be resolved. It indicates a corrupt or incomplete trash entry rather than a transient failure.","triggerScenarios":"Calling `Trash::list(Some(entry))` on a directory trash entry whose `original` field is None (the recycle-bin record lacks a put-back path).","commonSituations":"Recycle-bin metadata missing or damaged (e.g. $R/$I record mismatch), entries restored manually outside the app, entries imported from another drive/user profile.","solutions":["Skip entries without an original path and surface them as unrestorable.","Check `entry.original.is_some()` before attempting child listing/restore of the entry.","Repair the recycle-bin record by deleting and re-trashing the item, or restore it via Explorer if possible.","Treat io::ErrorKind::NotFound as data-level unavailability, not a bug in your code."],"exampleFix":"// before\nlet original = entry.original.as_deref()?;\n// after\nmatch entry.original.as_deref() {\n    Some(original) => { /* proceed */ }\n    None => eprintln!(\"skipping {} (no put-back location)\", entry.key()),\n}","handlingStrategy":"validation","validationCode":"let Some(original) = entry.original.as_deref() else {\n    eprintln!(\"entry has no put-back location; skipping\");\n    return Ok(());\n};","typeGuard":"fn has_put_back(entry: &TrashEntry) -> bool { entry.original.is_some() }","tryCatchPattern":"match trash.list(Some(&entry)) {\n    Ok(children) => children,\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => Vec::new(),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Skip entries lacking an original path in listings.","Flag such entries as unrestorable in the UI.","Detect recycle-bin metadata corruption early and warn."],"tags":["windows","trash","missing-path","filesystem","rust"],"backgroundTag":"missing-put-back-location","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}