зеркало из https://github.com/nextcloud/desktop.git
Add no changes error code in NKError extension
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Родитель
a0c819fdbe
Коммит
d639baeea0
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче