From e8d843c93da696efe8a7453c38b1a7d6803be419 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sun, 14 Jun 2020 14:55:27 +0200 Subject: [PATCH] Remove stacktrace if hardlink resulted in EXDEV. --- src/NzbDrone.Mono/Disk/DiskProvider.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Mono/Disk/DiskProvider.cs b/src/NzbDrone.Mono/Disk/DiskProvider.cs index 6340a637f..41da17e3a 100644 --- a/src/NzbDrone.Mono/Disk/DiskProvider.cs +++ b/src/NzbDrone.Mono/Disk/DiskProvider.cs @@ -410,9 +410,21 @@ public override bool TryCreateHardLink(string source, string destination) fileInfo.CreateLink(destination); return true; } + catch (UnixIOException ex) + { + if (ex.ErrorCode == Errno.EXDEV) + { + Logger.Trace("Hardlink '{0}' to '{1}' failed due to cross-device access.", source, destination); + } + else + { + Logger.Debug(ex, "Hardlink '{0}' to '{1}' failed.", source, destination); + } + return false; + } catch (Exception ex) { - Logger.Debug(ex, string.Format("Hardlink '{0}' to '{1}' failed.", source, destination)); + Logger.Debug(ex, "Hardlink '{0}' to '{1}' failed.", source, destination); return false; } }