tonhowtf/omniget · error
falhou
Error message
{} falhou: {} What it means
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.
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
Defensive patterns
Strategy: try-catch
Validate before calling
if !program_exists(program) {
anyhow::bail!("{} não encontrado no PATH", program);
} Try / catch
match uninstall::uninstall(&app).await {
Ok(msg) => log::info!("{}", msg),
Err(e) => {
let msg = e.to_string();
// msg embeds stderr from the package manager; surface it to the user
log::error!("uninstall failed: {}", msg);
}
} Prevention
- 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'
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/1de5aaeb278d474d.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/uninstall.rs:47
pub path: String,
pub bytes: u64,
}
fn home() -> PathBuf {
dirs::home_dir().unwrap_or_default()
}
fn size_of(path: &Path) -> u64 {
super::sysclean::measure(path).0
}
async fn run(program: &str, args: &[&str]) -> anyhow::Result<String> {
let o = crate::core::process::command(program)
.args(args)
.output()
.await?;
if !o.status.success() {
return Err(anyhow!(
"{} falhou: {}",
program,
String::from_utf8_lossy(if o.stderr.is_empty() {
&o.stdout
} else {
&o.stderr
})
.trim()
));
}
Ok(String::from_utf8_lossy(&o.stdout).to_string())
}
// ── macOS ──────────────────────────────────────────────────────────────
async fn mac_list(progress: &super::ProgressFn) -> Vec<App> {
let mut out = Vec::new();
let mut paths = Vec::new();View on GitHub (pinned to 8600b91f42)