diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-02 13:51:53 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-02 13:51:53 -0400 |
| commit | eadad7311777c68cf7daa55e267b296573466b8a (patch) | |
| tree | 6cd384a16198f24401fcf0cb0edef39e44175311 /MediaBrowser.Common/System/OperatingSystem.cs | |
| parent | 123bfbcf19a06bc45f13ff0c25b1f34a5d9f94b8 (diff) | |
| parent | 5a816f0b22cec12d193b19fcb9f21c7d085a3fbf (diff) | |
Merge branch 'master' into use-development-exception-page
Diffstat (limited to 'MediaBrowser.Common/System/OperatingSystem.cs')
| -rw-r--r-- | MediaBrowser.Common/System/OperatingSystem.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/MediaBrowser.Common/System/OperatingSystem.cs b/MediaBrowser.Common/System/OperatingSystem.cs index 7d38ddb6e..5f673d320 100644 --- a/MediaBrowser.Common/System/OperatingSystem.cs +++ b/MediaBrowser.Common/System/OperatingSystem.cs @@ -35,7 +35,7 @@ namespace MediaBrowser.Common.System case OperatingSystemId.Linux: return "Linux"; case OperatingSystemId.Darwin: return "macOS"; case OperatingSystemId.Windows: return "Windows"; - default: throw new Exception($"Unknown OS {Id}"); + default: throw new PlatformNotSupportedException($"Unknown OS {Id}"); } } } @@ -53,20 +53,20 @@ namespace MediaBrowser.Common.System default: { string osDescription = RuntimeInformation.OSDescription; - if (osDescription.IndexOf("linux", StringComparison.OrdinalIgnoreCase) != -1) + if (osDescription.Contains("linux", StringComparison.OrdinalIgnoreCase)) { return OperatingSystemId.Linux; } - else if (osDescription.IndexOf("darwin", StringComparison.OrdinalIgnoreCase) != -1) + else if (osDescription.Contains("darwin", StringComparison.OrdinalIgnoreCase)) { return OperatingSystemId.Darwin; } - else if (osDescription.IndexOf("bsd", StringComparison.OrdinalIgnoreCase) != -1) + else if (osDescription.Contains("bsd", StringComparison.OrdinalIgnoreCase)) { return OperatingSystemId.BSD; } - throw new Exception($"Can't resolve OS with description: '{osDescription}'"); + throw new PlatformNotSupportedException($"Can't resolve OS with description: '{osDescription}'"); } } } |
