{"record":{"id":"f10670eee970d28f","repo":"Hmbown/CodeWhale","slug":"failed-to-launch-browser-command-e","errorCode":null,"errorMessage":"failed to launch browser command: {e}","messagePattern":"failed to launch browser command: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/utils.rs","lineNumber":508,"sourceCode":"/// Open a URL in the system's default browser.\n///\n/// Dispatches to the platform-appropriate opener:\n/// - macOS: `open`\n/// - Linux / BSD: `xdg-open`\n/// - Windows: `cmd /C start \"\"`\n/// - Other: returns an error.\n///\n/// This is the single entry point for URL opening — every call site in\n/// the codebase should use this instead of hardcoding `Command::new(\"open\")`,\n/// `Command::new(\"xdg-open\")`, or `Command::new(\"cmd\")`.\npub fn open_url(url: &str) -> Result<()> {\n    let mut command = browser_open_command(url)?;\n    command\n        .stdout(std::process::Stdio::null())\n        .stderr(std::process::Stdio::null())\n        .spawn()\n        .map(|_| ())\n        .map_err(|e| anyhow::anyhow!(\"failed to launch browser command: {e}\"))\n}\n\nfn browser_open_command(url: &str) -> Result<Command> {\n    if url.trim().is_empty() {\n        return Err(anyhow::anyhow!(\"browser URL cannot be empty\"));\n    }\n\n    #[cfg(target_os = \"macos\")]\n    {\n        let mut command = Command::new(\"open\");\n        command.arg(url);\n        Ok(command)\n    }\n\n    #[cfg(any(\n        all(target_os = \"linux\", not(target_env = \"ohos\")),\n        target_os = \"netbsd\",\n        target_os = \"freebsd\",","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/utils.rs#L490-L526","documentation":"open_url failed to spawn the platform browser opener process (open, xdg-open, or cmd /C start) — the Command::spawn call returned an OS error (missing binary, permissions, resource limits). The URL itself was valid; the launch mechanism failed.","triggerScenarios":"Thrown at crates/tui/src/utils.rs:508 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install or repair the platform opener (xdg-open on Linux/BSD, open on macOS) and ensure it is on PATH.","Print the URL so the user can open it manually.","Retry with an alternate opener such as xdg-open, gio open, or a browser binary discovered from the environment."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}