{"record":{"id":"f49d86b38701f97b","repo":"sxyazi/yazi","slug":"invalid-restore-target","errorCode":null,"errorMessage":"invalid restore target","messagePattern":"invalid restore target","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/trash/windows/trash.rs","lineNumber":127,"sourceCode":"\t\tfs::rename(&entry.backing, path)\n\t}\n\n\tfn restore_do(&self, item: &ShellItem, to: &Path) -> io::Result<()> {\n\t\tmatch fs::symlink_metadata(to) {\n\t\t\tOk(_) => {\n\t\t\t\treturn Err(io::Error::new(\n\t\t\t\t\tio::ErrorKind::AlreadyExists,\n\t\t\t\t\tformat!(\"restore target already exists: {to:?}\"),\n\t\t\t\t));\n\t\t\t}\n\t\t\tErr(e) if e.kind() == io::ErrorKind::NotFound => {}\n\t\t\tErr(e) => return Err(e),\n\t\t}\n\n\t\t// Create parent directories\n\t\tlet parent = to\n\t\t\t.parent()\n\t\t\t.ok_or_else(|| io::Error::new(io::ErrorKind::InvalidInput, \"invalid restore target\"))?;\n\t\tfs::create_dir_all(parent)?;\n\n\t\tlet parent = ShellItem::new(parent)?;\n\t\tlet name: Vec<u16> = to\n\t\t\t.file_name()\n\t\t\t.ok_or_else(|| io::Error::new(io::ErrorKind::InvalidInput, \"invalid restore target\"))?\n\t\t\t.encode_wide()\n\t\t\t.chain([0])\n\t\t\t.collect();\n\n\t\toperate(FOF_NO_UI | FOFX_EARLYFAILURE, |operation| unsafe {\n\t\t\toperation.MoveItem(&item.0, &parent.0, PCWSTR(name.as_ptr()), None)\n\t\t})\n\t}\n\n\tpub(crate) fn empty(&self) -> io::Result<()> {\n\t\tunsafe {\n\t\t\tSHEmptyRecycleBinW(","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/sxyazi/yazi/blob/441b332de8b8800e70784cfbfb75369ab51ed9dd/yazi-fs/src/trash/windows/trash.rs#L109-L145","documentation":"Error \"invalid restore target\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-fs/src/trash/windows/trash.rs:127 when the library encounters an invalid state.","commonSituations":"Restoring to a target path that is invalid or fails validation on Windows.","solutions":["The recorded restore target path is invalid; restore the item manually from the Recycle Bin."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"441b332de8b8800e70784cfbfb75369ab51ed9dd","analyzedAt":"2026-08-19T05:27:26.468Z","contentChangedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}