1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-29 03:05:49 +00:00

Fixed: Logging error when accessing mount point

Fixes #1993
This commit is contained in:
Mark McDowall 2017-06-27 22:50:18 -07:00 committed by Taloth
parent 6bfb790eb8
commit 2246dfab05

View file

@ -40,24 +40,15 @@ namespace NzbDrone.Mono.Disk
{
Ensure.That(path, () => path).IsValidPath();
try
{
var mount = GetMount(path);
var mount = GetMount(path);
if (mount == null)
{
Logger.Debug("Unable to get free space for '{0}', unable to find suitable drive", path);
return null;
}
return mount.AvailableFreeSpace;
}
catch (InvalidOperationException ex)
if (mount == null)
{
Logger.Error(ex, "Couldn't get free space for {0}", path);
Logger.Debug("Unable to get free space for '{0}', unable to find suitable drive", path);
return null;
}
return null;
return mount.AvailableFreeSpace;
}
public override void InheritFolderPermissions(string filename)
@ -100,20 +91,9 @@ namespace NzbDrone.Mono.Disk
{
Ensure.That(path, () => path).IsValidPath();
try
{
var mount = GetMount(path);
var mount = GetMount(path);
if (mount == null) return null;
return mount.TotalSize;
}
catch (InvalidOperationException e)
{
Logger.Error(e, "Couldn't get total space for {0}", path);
}
return null;
return mount?.TotalSize;
}
public override bool TryCreateHardLink(string source, string destination)