{"record":{"id":"e852b1b3fcc209b9","repo":"zed-industries/zed","slug":"can-not-open-target-path","errorCode":null,"errorMessage":"Can not open target path: {}","messagePattern":"Can not open target path: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_windows/src/platform.rs","lineNumber":1345,"sourceCode":"    if ret.0 as isize <= 32 {\n        Err(anyhow::anyhow!(\n            \"Unable to open target: {}\",\n            std::io::Error::last_os_error()\n        ))\n    } else {\n        Ok(())\n    }\n}\n\nfn open_target_in_explorer(target: &Path) -> Result<()> {\n    let dir = target.parent().context(\"No parent folder found\")?;\n    let desktop = unsafe { SHGetDesktopFolder()? };\n\n    let mut dir_item = std::ptr::null_mut();\n    unsafe {\n        desktop.ParseDisplayName(\n            HWND::default(),\n            None,\n            &HSTRING::from(dir),\n            None,\n            &mut dir_item,\n            std::ptr::null_mut(),\n        )?;\n    }\n\n    let mut file_item = std::ptr::null_mut();\n    unsafe {\n        desktop.ParseDisplayName(\n            HWND::default(),\n            None,\n            &HSTRING::from(target),\n            None,\n            &mut file_item,\n            std::ptr::null_mut(),\n        )?;\n    }","sourceCodeStart":1327,"sourceCodeEnd":1363,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_windows/src/platform.rs#L1327-L1363","documentation":"Raised in the 'reveal in file manager' path when `SHOpenFolderAndSelectItems` fails with an error other than ERROR_FILE_NOT_FOUND (that case is already retried via a ShellExecute fallback in the or_else). Means Explorer could not open the parent folder and highlight the item, e.g. the folder disappeared, an invalid PIDL was built, or the path no longer exists.","triggerScenarios":"Thrown at crates/gpui_windows/src/platform.rs:1274 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the target path still exists before building PIDLs via ParseDisplayName.","Widen the fallback: also treat ERROR_PATH_NOT_FOUND and ERROR_INVALID_HANDLE as the ShellExecute fallback case.","Report the COM/Win32 error code to the user ('could not reveal file').","Retry once; Explorer can transiently fail while refreshing a folder."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}