tonhowtf/omniget · error

reg falhou

Error message

reg falhou: {}

What it means

A reg.exe add/delete invoked by reg_set exited non-zero and the failure was not the tolerated 'delete of a missing value' case (the code ignores 'unable to find' / 'não foi possível' / empty stderr for Delete operations). The {} is reg.exe's trimmed stderr; typical causes are elevation requirements and invalid value data.

Solutions

  1. Read the reg.exe stderr in the message to identify the failing value or key
  2. Run the app elevated when applying tweaks that touch HKLM
  3. Verify the rule's registry path and data format (e.g. DWORD vs SZ)
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-tauri/omniget-core/src/core/tools/win_tweaks.rs:556 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/0a4e78bb924f0f8b. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/win_tweaks.rs:556

                cmd.arg("/ve");
            } else {
                cmd.args(["/v", name]);
            }
            cmd.args(["/t", "REG_SZ", "/d", s, "/f"]);
        }
    }
    let out = cmd.output().await?;
    if !out.status.success() {
        let msg = String::from_utf8_lossy(&out.stderr).trim().to_string();
        // apagar o que não existe não é erro
        if matches!(value, RegValue::Delete)
            && (msg.contains("unable to find")
                || msg.contains("não foi possível")
                || msg.is_empty())
        {
            return Ok(());
        }
        return Err(anyhow!("reg falhou: {}", msg));
    }
    Ok(())
}

#[cfg(target_os = "windows")]
async fn is_admin() -> bool {
    crate::core::process::command("net")
        .args(["session"])
        .output()
        .await
        .map(|o| o.status.success())
        .unwrap_or(false)
}

#[allow(unused_mut)]
pub async fn status() -> TweaksStatus {
    let mut rules = rules();
    #[cfg(target_os = "windows")]

View on GitHub (pinned to 8600b91f42)