update directory picker

This commit is contained in:
Luke Pulverenti
2017-04-02 00:08:07 -04:00
parent 733b891f52
commit 6e4d234212
4 changed files with 41 additions and 22 deletions

View File

@@ -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;