{"record":{"id":"c5c18d224b0352b1","repo":"sxyazi/yazi","slug":"trash-item-has-no-put-back-location-c5c18d","errorCode":null,"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/macos/trash.rs","lineNumber":102,"sourceCode":"\t\tlet changed = !latest.cha.hits(current.cha)\n\t\t\t|| latest.extra.link_to() != current.extra.link_to()\n\t\t\t|| latest.extra.backing() != current.extra.backing();\n\n\t\tOk(changed.then_some(latest))\n\t}\n\n\tpub(crate) fn remove_file(&self, entry: &TrashEntry) -> io::Result<()> {\n\t\tfs::remove_file(&entry.backing)\n\t}\n\n\tpub(crate) fn remove_dir(&self, entry: &TrashEntry) -> io::Result<()> {\n\t\tfs::remove_dir(&entry.backing)\n\t}\n\n\tpub(crate) fn restore(&self, entries: TrashEntries) -> io::Result<()> {\n\t\tfor entry in entries {\n\t\t\tlet to = entry.original.as_ref().ok_or_else(|| {\n\t\t\t\tio::Error::new(io::ErrorKind::NotFound, \"trash item has no put-back location\")\n\t\t\t})?;\n\n\t\t\trestore_item(&entry.backing, to)?;\n\t\t}\n\t\tOk(())\n\t}\n\n\tpub(crate) fn rename(&self, entry: &TrashEntry, path: &Path) -> io::Result<()> {\n\t\tfs::rename(&entry.backing, path)\n\t}\n\n\tpub(crate) fn empty(&self) -> io::Result<()> {\n\t\tlet root = self.root()?;\n\t\tfor dent in ok_or_not_found!(fs::read_dir(root), return Ok(())) {\n\t\t\tlet dent = dent?;\n\t\t\tif dent.file_type()?.is_dir() {\n\t\t\t\tfs::remove_dir_all(dent.path())?;\n\t\t\t} else {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/sxyazi/yazi/blob/8ebf930f1796ae2076b7d6b0c5e93a1002c18134/yazi-fs/src/trash/macos/trash.rs#L84-L120","documentation":"Fired in the macOS trash backend's restore() when a TrashEntry read from the ~/.Trash back-end has no original put-back URL recorded. This happens when the entry's trash metadata (bookmark/plist) is missing or corrupt — e.g. it was deleted, hand-edited, or never written when the item was trashed — so the item cannot be moved back to its original path. It surfaces as an io::Error with InvalidInput kind from the restore loop.","triggerScenarios":"Thrown at yazi-fs/src/trash/macos/trash.rs:102 when the library encounters an invalid state.","commonSituations":"Restoring a macOS trash item for which no original location can be determined.","solutions":["No put-back location is recorded for this item; restore it manually from ~/.Trash."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8ebf930f1796ae2076b7d6b0c5e93a1002c18134","analyzedAt":"2026-09-09T22:26:16.379Z","contentChangedAt":"2026-09-09T22:26:16.379Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}