From d639baeea0256b90a5d37933b9834c5c45128d37 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 13 Mar 2023 14:38:21 +0100 Subject: [PATCH] Add no changes error code in NKError extension Signed-off-by: Claudio Cambra --- .../Extensions/NKError+Extensions.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift index b8f912ab0..c82162e85 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Extensions/NKError+Extensions.swift @@ -17,6 +17,12 @@ import FileProvider import NextcloudKit extension NKError { + static var noChangesErrorCode: Int { + get { + return -200 + } + } + var isCouldntConnectError: Bool { get { let nkErrorCode = self.errorCode @@ -52,6 +58,12 @@ extension NKError { } } + var isNoChangesError: Bool { + get { + return self.errorCode == NKError.noChangesErrorCode + } + } + func toFileProviderError() -> NSFileProviderError { if self.isNotFoundError { return NSFileProviderError(.noSuchItem)