SubtitleEdit/subtitleedit · error · PlatformNotSupportedException

Operation is not supported on this platform.

Error message

Operation is not supported on this platform.

What it means

PlatformNotSupportedException with no message from Qwen3TtsCppDownloadService.GetUrl when the OS is neither Linux nor macOS (and implicitly not Windows, handled earlier). Defensive fallthrough.

Source

Thrown at src/ui/Logic/Download/Qwen3TtsCppDownloadService.cs:151

            return windowsVariant switch
            {
                WindowsVariantCpu => WindowsCpuUrl,
                WindowsVariantCuda => WindowsCudaUrl,
                _ => WindowsVulkanUrl,
            };
        }

        if (OperatingSystem.IsLinux())
        {
            return RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ? LinuxArmUrl : LinuxUrl;
        }

        if (OperatingSystem.IsMacOS())
        {
            return MacUrl;
        }

        throw new PlatformNotSupportedException();
    }
}

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Confirm the host is a supported OS.
  2. Update the runtime for reliable detection.
  3. Add a returning branch if a new platform is intentionally supported.
  4. Report a bug if a supported OS reaches this throw.

Example fix

// before
throw new PlatformNotSupportedException();

// after
throw new PlatformNotSupportedException(
    $"Qwen3-TTS (cpp) has no build for OS={RuntimeInformation.OSDescription}.");
Defensive patterns

Strategy: validation

Validate before calling

if (!OperatingSystem.IsWindows() && !OperatingSystem.IsLinux() && !OperatingSystem.IsMacOS())
{
    throw new InvalidOperationException($"Unsupported OS for Qwen3-TTS: {RuntimeInformation.OSDescription}");
}

Try / catch

try { url = service.GetUrl(...); }
catch (PlatformNotSupportedException) { /* engine unavailable on this OS; hide option */ }

Prevention

When it happens

Trigger: All of Windows (implicit), Linux (x64/arm64), and macOS branches fail to return - effectively an unrecognized platform.

Common situations: Unusual OS, containerized runtime misreporting platform, or a future refactor that adds an OS branch without removing the fallthrough.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/6913d19706b3988b. Report an issue: GitHub.