{"record":{"id":"7d5965ee29497071","repo":"tonhowtf/omniget","slug":"spicetify-falhou","errorCode":null,"errorMessage":"spicetify {} falhou{}","messagePattern":"spicetify (.+?) falhou(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/spicetify.rs","lineNumber":113,"sourceCode":"        code: output.status.code(),\n        stdout: strip_ansi(&String::from_utf8_lossy(&output.stdout)),\n        stderr: strip_ansi(&String::from_utf8_lossy(&output.stderr)),\n    })\n}\n\n/// Falha vira `Err` com a mensagem que o Spicetify imprimiu, para a UI\n/// mostrar o motivo real (\"Spotify not found\", \"already patched\"…).\npub async fn run_ok(bin: &Path, args: &[&str]) -> anyhow::Result<CmdOutput> {\n    let out = run(bin, args).await?;\n    if out.ok {\n        return Ok(out);\n    }\n    let msg = if out.stderr.trim().is_empty() {\n        out.stdout.trim().to_string()\n    } else {\n        out.stderr.trim().to_string()\n    };\n    Err(anyhow!(\n        \"spicetify {} falhou{}\",\n        args.join(\" \"),\n        if msg.is_empty() {\n            String::new()\n        } else {\n            format!(\": {}\", msg)\n        }\n    ))\n}\n\n// ---------- config.ini ----------\n\n#[derive(Debug, Default, Clone, Serialize)]\npub struct SpicetifyConfig {\n    pub spotify_path: String,\n    pub prefs_path: String,\n    pub current_theme: String,\n    pub color_scheme: String,","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/spicetify.rs#L95-L131","documentation":"`run_ok` executes a spicetify CLI subcommand and requires it to exit successfully. When the command exits with a non-zero status, the library wraps the CLI's stderr (or stdout if stderr is empty) into this Portuguese error message. It is the generic surfacing point for any failure of the spicetify binary itself.","triggerScenarios":"Calling install_marketplace -> run_ok with args like `[\"backup\",\"apply\"]` or `[\"config-dir\"]` when the spicetify CLI exits non-zero — e.g. Spotify not installed, corrupted spicetify state, or an unsupported subcommand.","commonSituations":"Spotify client version incompatible with spicetify; running `spicetify backup apply` without a prior `backup`; broken marketplace install; spicetify CLI printing an error to stderr; Spotify installed in a non-default location.","solutions":["Read the `: <message>` suffix of the error — it contains the CLI's own stderr explaining the root cause","Run the same spicetify command manually in a terminal to see the full output","Run `spicetify restore backup` / reinstall spicetify to reset corrupted state","Verify Spotify is installed at a location spicetify can detect and is a compatible version","Re-run the install from the app after fixing the underlying spicetify issue"],"exampleFix":"// before\nlet out = Command::new(&cli).args(&args).output()?;\nif !out.status.success() { /* error propagates with CLI stderr */ }\n// after\nlet out = Command::new(&cli).args(&args).env(\"HOME\", &home).output()?; // ensure correct env for CLI\nif !out.status.success() {\n    log::warn!(\"spicetify {:?} stderr: {}\", args, String::from_utf8_lossy(&out.stderr));\n    // surface msg to user / retry after `spicetify restore-backup`\n}","handlingStrategy":"try-catch","validationCode":"let out = Command::new(&cli).args(&args).output()?;\nif !out.status.success() {\n    eprintln!(\"spicetify will fail: {}\", String::from_utf8_lossy(&out.stderr));\n}","typeGuard":null,"tryCatchPattern":"match install_marketplace().await {\n    Err(e) if e.to_string().starts_with(\"spicetify\") => {\n        let cli_msg = e.to_string().splitn(2, \": \").nth(1).unwrap_or(\"\");\n        show_user_error(cli_msg); // show spicetify's own stderr\n    }\n    Err(e) => return Err(e),\n    Ok(_) => {}\n}","preventionTips":["Verify Spotify is installed and a supported version before invoking spicetify","Run `spicetify backup` before `apply`; restore backup after Spotify updates","Surface the CLI's stderr (the `: msg` suffix) to the user — it names the real cause","Keep spicetify-cli and the marketplace in compatible versions"],"tags":["process","cli","spicetify"],"backgroundTag":"git-command-failed","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"}