From ccd8d93e8224a282ade3910460ee40e2a5d782cc Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 18 May 2023 03:12:06 +0300 Subject: [PATCH] Fixed: Log name of mount point failure (cherry picked from commit b5050d02d6adbaaaa0f8ae9f8426551e5606fff1) Fixes #2503 --- src/NzbDrone.Mono/Disk/DiskProvider.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Mono/Disk/DiskProvider.cs b/src/NzbDrone.Mono/Disk/DiskProvider.cs index 633b3e7be..a774b79c7 100644 --- a/src/NzbDrone.Mono/Disk/DiskProvider.cs +++ b/src/NzbDrone.Mono/Disk/DiskProvider.cs @@ -201,10 +201,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) {