{"record":{"id":"0bf9cabe009d5bc2","repo":"SubtitleEdit/subtitleedit","slug":"operation-is-not-supported-on-this-platform-0bf9ca","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/OmniVoiceDownloadService.cs","lineNumber":140,"sourceCode":"                WindowsVariantCuda => WindowsCudaUrl,\n                WindowsVariantVulkan => WindowsVulkanUrl,\n                _ => WindowsCpuUrl,\n            };\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            return MacOsUrl;\n        }\n\n        if (OperatingSystem.IsLinux())\n        {\n            return RuntimeInformation.ProcessArchitecture == Architecture.Arm64\n                ? LinuxArm64Url\n                : LinuxX64Url;\n        }\n\n        throw new PlatformNotSupportedException();\n    }\n}\n","sourceCodeStart":122,"sourceCodeEnd":143,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/OmniVoiceDownloadService.cs#L122-L143","documentation":"PlatformNotSupportedException with no message, thrown by OmniVoiceDownloadService.GetUrl after the Windows/Mac/Linux branches all fail to match. It signals that the runtime OS is none of the recognized ones (or the OS detection returned something unexpected).","triggerScenarios":"GetUrl is reached only when OperatingSystem.IsWindows() is false, IsMacOS() is false, and IsLinux() is false - effectively only on an exotic/unsupported OS (BSD, Solaris, etc.) or a sandboxed runtime where OS detection is unreliable.","commonSituations":"Running under an unusual OS, an older runtime where OS guards behave differently, or in a constrained container that misreports the platform. In practice on Windows/Mac/Linux this path is unreachable, so hitting it usually means a detection bug or an unsupported deployment target.","solutions":["Confirm the host OS is one of Windows, macOS, or Linux (x64/arm64).","Upgrade the runtime so OperatingSystem detection is reliable.","If a legitimate platform is being rejected, extend GetUrl with a branch for it.","File a bug if detection fails on a supported OS."],"exampleFix":"// before\nthrow new PlatformNotSupportedException();\n\n// after - name the platform so the user can act on it\nthrow new PlatformNotSupportedException(\n    $\"OmniVoice engine has no build for this platform \" +\n    $\"(OS={RuntimeInformation.OSDescription}, ARCH={RuntimeInformation.ProcessArchitecture}).\");","handlingStrategy":"validation","validationCode":"if (!OperatingSystem.IsWindows() && !OperatingSystem.IsMacOS() && !OperatingSystem.IsLinux())\n{\n    // surface a clear message instead of letting GetUrl throw bare\n    throw new InvalidOperationException($\"Unsupported OS: {RuntimeInformation.OSDescription}\");\n}","typeGuard":null,"tryCatchPattern":"try { url = service.GetUrl(variant); }\ncatch (PlatformNotSupportedException) { /* show OS/ARCH not supported message, hide the engine */ }","preventionTips":["Gate engine availability in the UI by OS+ARCH before the user can request a download.","Upgrade the runtime so OS detection is reliable in containers.","Provide a clear user-facing message naming the unsupported platform."],"tags":["platform","platformnotsupported","omnivoice","csharp"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}