mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Add no changes error code in NKError extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
a0c819fdbe
commit
d639baeea0
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue