aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-04-07 15:26:59 -0400
committerGitHub <noreply@github.com>2017-04-07 15:26:59 -0400
commit7c55cd08cbfc1c4a6ba2823007432316e1efce8d (patch)
treeb045a71d84deeb89a85975d34a7a2ded2642c0d5 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parent66e901ef93942c631c3ee3b222cc75265e1b17fb (diff)
parent6f7d8bb742f3594bdca16fa5c20c55707edad158 (diff)
Merge pull request #2567 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 6d15cc619..ee5245a69 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -273,10 +273,19 @@ namespace Emby.Server.Implementations.HttpServer
return 400;
}
+ var exceptionType = ex.GetType();
+
int statusCode;
- if (!_mapExceptionToStatusCode.TryGetValue(ex.GetType(), out statusCode))
+ if (!_mapExceptionToStatusCode.TryGetValue(exceptionType, out statusCode))
{
- statusCode = 500;
+ if (string.Equals(exceptionType.Name, "DirectoryNotFoundException", StringComparison.OrdinalIgnoreCase))
+ {
+ statusCode = 404;
+ }
+ else
+ {
+ statusCode = 500;
+ }
}
return statusCode;