herdrdev/herdr · warning · io::Error

opening URLs is not supported on this platform

Error message

opening URLs is not supported on this platform

What it means

open_url on the fallback platform stub always returns Unsupported: Herdr has no mechanism to launch the OS browser/URL handler on this compiled target. Any code path that tries to open a URL (docs links, release notes, etc.) will receive this error.

Source

Thrown at src/platform/fallback.rs:216

/// Unsupported platform stub.
pub fn process_exists(_pid: u32) -> bool {
    false
}

/// Unsupported platform stub.
pub fn write_clipboard(_bytes: &[u8]) -> bool {
    false
}

/// Unsupported platform stub.
pub fn read_clipboard_text() -> Option<String> {
    None
}

/// Unsupported platform stub.
pub fn open_url(_url: &str) -> std::io::Result<Option<std::process::Child>> {
    Err(std::io::Error::new(
        std::io::ErrorKind::Unsupported,
        "opening URLs is not supported on this platform",
    ))
}

/// Unsupported platform stub.
// Windows does not wire clipboard-image bridging into semantic input yet.
#[cfg_attr(windows, allow(dead_code))]
pub fn read_clipboard_image() -> Option<ClipboardImage> {
    None
}

/// Unsupported platform stub.
pub fn show_desktop_notification(_title: &str, _body: Option<&str>) -> std::io::Result<bool> {
    Ok(false)
}

View on GitHub (pinned to f457cff4f2)

Solutions

  1. Run on a supported platform where open_url delegates to xdg-open/open/start
  2. When porting, implement open_url in the target's src/platform/<os>.rs module
  3. As a caller, degrade gracefully: match ErrorKind::Unsupported and show the URL as copyable text instead

Example fix

// before
platform::open_url(&url)?;
// after
match platform::open_url(&url) {
    Ok(_) => {}
    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => copy_to_clipboard(&url),
    Err(e) => return Err(e),
}
Defensive patterns

Strategy: fallback

Validate before calling

// no pre-call check exists; the stub always fails, so probe once
can_open_urls = matches!(platform::open_url("about:blank"), Err(e) if e.kind() != std::io::ErrorKind::Unsupported));

Try / catch

match platform::open_url(url) {
    Ok(child) => { /* spawned */ }
    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => show_copyable_link(url),
    Err(e) => report(e),
}

Prevention

When it happens

Trigger: Calling platform open_url() on a build that uses src/platform/fallback.rs. Every invocation returns Unsupported unconditionally, regardless of the URL string.

Common situations: Exotic or in-progress OS ports of Herdr; CI targets compiled without a browser layer. Users on Linux/macOS/Windows never hit it because those modules implement open_url.

Related errors


AI-assisted analysis of herdrdev/herdr@f457cff4f2 (2026-08-28). Data as JSON: /api/errors/03c4010f369c939e. Report an issue: GitHub.