{"record":{"id":"2a8384ee9a554fc8","repo":"sxyazi/yazi","slug":"invalid-trash-entry","errorCode":null,"errorMessage":"invalid trash entry","messagePattern":"invalid trash entry","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"yazi-fs/src/trash/trash_id.rs","lineNumber":23,"sourceCode":"use yazi_shim::path::PathExt;\n\n#[derive(Clone, Debug)]\npub(crate) struct TrashId {\n\ttop: PathBuf,\n\trel: PathBuf,\n}\n\nimpl TrashId {\n\tpub(super) fn new<T, R>(top: T, rel: R) -> io::Result<Self>\n\twhere\n\t\tT: Into<PathBuf>,\n\t\tR: Into<PathBuf>,\n\t{\n\t\tlet top = top.into();\n\t\tlet rel = rel.into();\n\n\t\tif top.as_os_str().is_empty() || !rel.is_relative() {\n\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidInput, \"invalid trash entry\"));\n\t\t}\n\t\tif rel.has_parent_component() {\n\t\t\treturn Err(io::Error::new(io::ErrorKind::InvalidInput, \"invalid trash entry path\"));\n\t\t}\n\n\t\tOk(Self { top, rel })\n\t}\n\n\tpub(super) fn top(&self) -> &Path { &self.top }\n\n\tpub(super) fn rel(&self) -> &Path { &self.rel }\n\n\t#[cfg(target_os = \"macos\")]\n\tpub(super) fn path(&self) -> PathBuf {\n\t\tif self.has_rel() { self.top.join(&self.rel) } else { self.top.clone() }\n\t}\n\n\tpub(super) fn child(&self, name: &OsStr) -> io::Result<Self> {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/sxyazi/yazi/blob/441b332de8b8800e70784cfbfb75369ab51ed9dd/yazi-fs/src/trash/trash_id.rs#L5-L41","documentation":"Error \"invalid trash entry\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-fs/src/trash/trash_id.rs:23 when the library encounters an invalid state.","commonSituations":"Parsing a trash entry identifier that does not match the expected trash ID format.","solutions":["The trash entry id is malformed; use an id produced by a previous trash operation on this platform."],"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-23T08:17:48.524Z"}