aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-04-02 00:46:26 -0400
committerGitHub <noreply@github.com>2017-04-02 00:46:26 -0400
commitc4a9dd3d262c880b8499e2f9b564d9ead99a7a22 (patch)
tree47077506324da6137d56e322299942ee6eeb9512 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parentb3640fbc9a0f7fd4a1def4e3c2f8860feb0f6922 (diff)
parent4a8960fc866143e7107a5bc41527db6c5581974f (diff)
Merge pull request #2562 from MediaBrowser/dev
Dev
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;