{"record":{"id":"6913d19706b3988b","repo":"SubtitleEdit/subtitleedit","slug":"operation-is-not-supported-on-this-platform-6913d1","errorCode":null,"errorMessage":"Operation is not supported on this platform.","messagePattern":"Operation is not supported on this platform\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"error","filePath":"src/ui/Logic/Download/Qwen3TtsCppDownloadService.cs","lineNumber":151,"sourceCode":"            return windowsVariant switch\n            {\n                WindowsVariantCpu => WindowsCpuUrl,\n                WindowsVariantCuda => WindowsCudaUrl,\n                _ => WindowsVulkanUrl,\n            };\n        }\n\n        if (OperatingSystem.IsLinux())\n        {\n            return RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ? LinuxArmUrl : LinuxUrl;\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            return MacUrl;\n        }\n\n        throw new PlatformNotSupportedException();\n    }\n}","sourceCodeStart":133,"sourceCodeEnd":153,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/Qwen3TtsCppDownloadService.cs#L133-L153","documentation":"PlatformNotSupportedException with no message from Qwen3TtsCppDownloadService.GetUrl when the OS is neither Linux nor macOS (and implicitly not Windows, handled earlier). Defensive fallthrough.","triggerScenarios":"All of Windows (implicit), Linux (x64/arm64), and macOS branches fail to return - effectively an unrecognized platform.","commonSituations":"Unusual OS, containerized runtime misreporting platform, or a future refactor that adds an OS branch without removing the fallthrough.","solutions":["Confirm the host is a supported OS.","Update the runtime for reliable detection.","Add a returning branch if a new platform is intentionally supported.","Report a bug if a supported OS reaches this throw."],"exampleFix":"// before\nthrow new PlatformNotSupportedException();\n\n// after\nthrow new PlatformNotSupportedException(\n    $\"Qwen3-TTS (cpp) has no build for OS={RuntimeInformation.OSDescription}.\");","handlingStrategy":"validation","validationCode":"if (!OperatingSystem.IsWindows() && !OperatingSystem.IsLinux() && !OperatingSystem.IsMacOS())\n{\n    throw new InvalidOperationException($\"Unsupported OS for Qwen3-TTS: {RuntimeInformation.OSDescription}\");\n}","typeGuard":null,"tryCatchPattern":"try { url = service.GetUrl(...); }\ncatch (PlatformNotSupportedException) { /* engine unavailable on this OS; hide option */ }","preventionTips":["Gate the Qwen3-TTS option by supported OS in the UI.","Keep the runtime current for accurate OS detection.","Provide a clear unsupported-platform message."],"tags":["platform","platformnotsupported","qwen3-tts","csharp"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}