aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-02 00:08:07 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-02 00:08:07 -0400
commit6e4d2342120c4bde4fdc99bc17dea0aec7b75ced (patch)
treecbbb88f9cfcb1924020dcc8f6f92aa438e8a6248 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parent733b891f529c2458d65560f556edf68052be2846 (diff)
update directory picker
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;