{"record":{"id":"c98806b82321ccba","repo":"SubtitleEdit/subtitleedit","slug":"operation-is-not-supported-on-this-platform-c98806","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/WhisperDownloadService.cs","lineNumber":127,"sourceCode":"\n    private static string GetUrlTranslate2()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            return WindowCTranslate2;\n        }\n        \n        if (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)\n        {\n            return MacArmCTranslate2;\n        }\n        \n        if (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.X64)\n        {\n            return LinuxCTranslate2;\n        }\n\n        throw new PlatformNotSupportedException();\n    }\n\n    private static string GetUrlCppVulkan()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            return WindowsUrlCppVulkan;\n        }\n\n        throw new PlatformNotSupportedException();\n    }\n    \n    private static string GetUrl()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            return WindowsUrl;\n        }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/WhisperDownloadService.cs#L109-L145","documentation":"Thrown by GetUrlTranslate2, which only has URLs for three targets: Windows (any arch), macOS ARM64, and Linux x64. Any combination outside those three (Linux ARM64, macOS Intel/x64, FreeBSD, or any other OS) falls through to the parameterless PlatformNotSupportedException. It fires from DownloadWhisperCTranslate2 before the HTTP request.","triggerScenarios":"Calling DownloadWhisperCTranslate2 on macOS x64 (Intel Mac), Linux ARM64, or any non-Windows/non-mac/non-Linux-x64 OS such as FreeBSD.","commonSituations":"An Intel Mac user or a Raspberry Pi / Graviton Linux user selects the CTranslate2 (GPU/CPU-fp) Whisper engine. The mapping table has no row for that platform.","solutions":["On macOS Intel use whisper.cpp (GetUrl serves MacX64Url) or run CTranslate2 under Rosetta on Apple Silicon.","On Linux ARM64 pick an engine that ships an aarch64 or universal build, or build whisper-ctranslate2 locally.","Extend GetUrlTranslate2 to return a URL for the missing platform if you publish your own CTranslate2 build.","Gate the CTranslate2 option in the engine picker on the supported platform set."],"exampleFix":"// before\nreturn LinuxCTranslate2; // only reached for Linux x64\n...\nthrow new PlatformNotSupportedException();\n\n// after: add an explicit, message-bearing branch so callers know what is missing\nif (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.X64)\n{\n    throw new PlatformNotSupportedException(\"CTranslate2 has no macOS Intel build; use whisper.cpp.\");\n}\nthrow new PlatformNotSupportedException($\"CTranslate2 not supported on {RuntimeInformation.OSDescription}/{RuntimeInformation.ProcessArchitecture}.\");","handlingStrategy":"validation","validationCode":"bool CTranslate2Supported() =>\n    OperatingSystem.IsWindows() ||\n    (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64) ||\n    (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.X64);","typeGuard":"static bool IsCTranslate2PlatformSupported() =>\n    OperatingSystem.IsWindows() ||\n    (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64) ||\n    (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.X64);","tryCatchPattern":"try { await svc.DownloadWhisperCTranslate2(stream, progress, ct); }\ncatch (PlatformNotSupportedException) { /* fall back to whisper.cpp */ }","preventionTips":["Check IsCTranslate2PlatformSupported() before exposing the CTranslate2 engine.","Note the macOS branch only covers Apple Silicon, not Intel Macs."],"tags":["platform","whisper","download","ctranslate2","architecture"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}