update access denied exceptions

This commit is contained in:
Luke Pulverenti
2015-09-25 22:31:13 -04:00
parent c31aab2d64
commit ebc95ffb9a
11 changed files with 47 additions and 42 deletions

View File

@@ -120,8 +120,6 @@ namespace MediaBrowser.Api
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
/// <exception cref="System.ArgumentNullException">Path</exception>
/// <exception cref="System.ArgumentException"></exception>
public object Get(GetDirectoryContents request)
{
var path = request.Path;
@@ -138,15 +136,7 @@ namespace MediaBrowser.Api
return ToOptimizedSerializedResultUsingCache(GetNetworkShares(path).OrderBy(i => i.Path).ToList());
}
try
{
return ToOptimizedSerializedResultUsingCache(GetFileSystemEntries(request).OrderBy(i => i.Path).ToList());
}
catch (UnauthorizedAccessException)
{
// Don't throw the original UnauthorizedAccessException because it will cause a 401 response
throw new ApplicationException("Access to the path " + request.Path + " is denied.");
}
return ToOptimizedSerializedResultUsingCache(GetFileSystemEntries(request).OrderBy(i => i.Path).ToList());
}
public object Get(GetNetworkShares request)