{"record":{"id":"1de5aaeb278d474d","repo":"tonhowtf/omniget","slug":"falhou-uninstall","errorCode":null,"errorMessage":"{} falhou: {}","messagePattern":"(.+?) falhou: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/uninstall.rs","lineNumber":47,"sourceCode":"    pub path: String,\n    pub bytes: u64,\n}\n\nfn home() -> PathBuf {\n    dirs::home_dir().unwrap_or_default()\n}\n\nfn size_of(path: &Path) -> u64 {\n    super::sysclean::measure(path).0\n}\n\nasync fn run(program: &str, args: &[&str]) -> anyhow::Result<String> {\n    let o = crate::core::process::command(program)\n        .args(args)\n        .output()\n        .await?;\n    if !o.status.success() {\n        return Err(anyhow!(\n            \"{} falhou: {}\",\n            program,\n            String::from_utf8_lossy(if o.stderr.is_empty() {\n                &o.stdout\n            } else {\n                &o.stderr\n            })\n            .trim()\n        ));\n    }\n    Ok(String::from_utf8_lossy(&o.stdout).to_string())\n}\n\n// ── macOS ──────────────────────────────────────────────────────────────\n\nasync fn mac_list(progress: &super::ProgressFn) -> Vec<App> {\n    let mut out = Vec::new();\n    let mut paths = Vec::new();","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/uninstall.rs#L29-L65","documentation":"run() is a generic helper in uninstall.rs that spawns an external program (apt, dnf, osascript, msiexec, etc.) and captures its output. When the child process exits with a non-zero status, the helper wraps the failure into this error, preferring stderr output (falling back to stdout) in the message. It reports a failed external uninstaller command, not a Rust-side bug.","triggerScenarios":"Any uninstall path that shells out to a package manager or system tool whose invocation exits non-zero: apt/rpm/dnf removal failing, msiexec /x failing, or osascript failing to move an app to Trash.","commonSituations":"Package not found by the system package manager; missing sudo/pkexec privileges; corrupted uninstall registry entry; MSI database errors; locked files on macOS preventing Trash move.","solutions":["Read the stderr portion of the error message — it contains the actual package manager/system tool diagnostics","Re-run the failing command manually in a terminal (e.g. `sudo apt remove -y <pkg>`) to see full output","Ensure the process has sufficient privileges (root/pkexec) for system package operations","Verify the program named in the message is installed and on PATH"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !program_exists(program) {\n    anyhow::bail!(\"{} não encontrado no PATH\", program);\n}","typeGuard":null,"tryCatchPattern":"match uninstall::uninstall(&app).await {\n    Ok(msg) => log::info!(\"{}\", msg),\n    Err(e) => {\n        let msg = e.to_string();\n        // msg embeds stderr from the package manager; surface it to the user\n        log::error!(\"uninstall failed: {}\", msg);\n    }\n}","preventionTips":["Check the program is installed/on PATH before shelling out","Ensure the process has privileges (sudo/pkexec) for package operations","Parse the embedded stderr to distinguish 'not found' from 'permission denied'"],"tags":["process","subprocess","external-command","uninstall","rust"],"backgroundTag":"http-error-response","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}