The Free Software Media System - Server Backend & API
Merge branch 'dev' into reformat
Erwin de Haand116efe1f78c
diff --cc Emby.Naming/Emby.Naming.csprojindex 7b40f905b0,de40a39d20..49619d5560--- a/Emby.Naming/Emby.Naming.csproj+++ b/Emby.Naming/Emby.Naming.csproj@@@ -1,16 -1,23 +1,23 @@@<Project Sdk="Microsoft.NET.Sdk">- <PropertyGroup>- <TargetFramework>netstandard2.0</TargetFramework>- <GenerateAssemblyInfo>false</GenerateAssemblyInfo>- </PropertyGroup>+ <PropertyGroup>+ <TargetFramework>netstandard2.0</TargetFramework>+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>+ </PropertyGroup>++ <ItemGroup>+ <Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />+ </ItemGroup>++ <ItemGroup>+ <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />+ </ItemGroup>+ <PropertyGroup>+ <Authors>Jellyfin Contributors</Authors>+ <PackageId>Jellyfin.Naming</PackageId>+ <PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>+ <RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>+ </PropertyGroup>+- <ItemGroup>- <Compile Include="..\SharedVersion.cs" Link="SharedVersion.cs" />- </ItemGroup>-- <ItemGroup>- <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />- </ItemGroup>-</Project>diff --cc Emby.Server.Implementations/HttpServer/HttpListenerHost.csindex 163b54e39d,6b4f2bced5..033ffd4c02--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs@@@ -205,26 -197,16 +196,16 @@@ namespace Emby.Server.Implementations.Hprivate int GetStatusCode(Exception ex){- if (ex is ArgumentException)- {- return 400;- }-- var exceptionType = ex.GetType();-- if (!_mapExceptionToStatusCode.TryGetValue(exceptionType, out var statusCode))+ switch (ex){- if (ex is DirectoryNotFoundException)- {- statusCode = 404;- }- else- {- statusCode = 500;- }- case ArgumentException _: return 400;- case SecurityException _: return 401;++ case ArgumentException _: return 400;++ case SecurityException _: return 401;+ case DirectoryNotFoundException _:+ case FileNotFoundException _:- case ResourceNotFoundException _: return 404;++ case ResourceNotFoundException _: return 404;+ case RemoteServiceUnavailableException _: return 502;- default: return 500;++ default: return 500;}-- return statusCode;}private async Task ErrorHandler(Exception ex, IRequest httpReq, bool logExceptionStackTrace, bool logExceptionMessage)