Fixed: Log name of mount point failure

(cherry picked from commit b5050d02d6adbaaaa0f8ae9f8426551e5606fff1)
This commit is contained in:
Bogdan 2023-05-18 03:12:06 +03:00
parent 3feaee25e2
commit 574d1c8d0f
1 changed files with 12 additions and 4 deletions

View File

@ -182,10 +182,18 @@ namespace NzbDrone.Mono.Disk
try
{
mounts.AddRange(GetDriveInfoMounts()
.Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
.Where(d => d.DriveType == DriveType.Fixed ||
d.DriveType == DriveType.Network ||
d.DriveType == DriveType.Removable));
.Select(d =>
{
try
{
return new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat));
}
catch (Exception ex)
{
throw new Exception($"Failed to fetch drive info for mount point: {d.Name}", ex);
}
})
.Where(d => d.DriveType is DriveType.Fixed or DriveType.Network or DriveType.Removable));
}
catch (Exception e)
{