{"record":{"id":"bd27afcbb8da9ef3","repo":"tonhowtf/omniget","slug":"reg-delete-falhou","errorCode":null,"errorMessage":"reg delete falhou: {}","messagePattern":"reg delete falhou: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/win_registry.rs","lineNumber":112,"sourceCode":"    }\n}\n\npub async fn reg_delete(key: &str, value: Option<&str>) -> anyhow::Result<()> {\n    let mut cmd = crate::core::process::command(\"reg\");\n    cmd.arg(\"delete\").arg(key);\n    match value {\n        Some(\"\") => {\n            cmd.arg(\"/ve\");\n        }\n        Some(v) => {\n            cmd.arg(\"/v\").arg(v);\n        }\n        None => {}\n    }\n    cmd.arg(\"/f\");\n    let o = cmd.output().await?;\n    if !o.status.success() {\n        return Err(anyhow!(\n            \"reg delete falhou: {}\",\n            String::from_utf8_lossy(&o.stderr).trim()\n        ));\n    }\n    Ok(())\n}\n\npub async fn reg_add(key: &str, value: &str, kind: &str, data: &str) -> anyhow::Result<()> {\n    let mut cmd = crate::core::process::command(\"reg\");\n    cmd.arg(\"add\").arg(key);\n    if value.is_empty() {\n        cmd.arg(\"/ve\");\n    } else {\n        cmd.arg(\"/v\").arg(value);\n    }\n    cmd.arg(\"/t\").arg(kind).arg(\"/d\").arg(data).arg(\"/f\");\n    let o = cmd.output().await?;\n    if !o.status.success() {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/win_registry.rs#L94-L130","documentation":"The Windows `reg delete` command (with /ve, /v, and /f as appropriate) exited non-zero; the {} is reg.exe's stderr. Fired from reg_delete, which fix uses to remove registry values — typically the key path is malformed, inaccessible without elevation, or reg.exe refused the forced delete.","triggerScenarios":"Thrown at src-tauri/omniget-core/src/core/tools/win_registry.rs:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the exact key path and value name for typos or wrong HKCU/HKLM hive","Run the application as administrator when deleting from HKEY_LOCAL_MACHINE","Test the equivalent `reg delete <key> /f` in a terminal to see the raw error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}