Open johnnyperdomo opened 5 years ago
one solution i found to return a response to the user, whether it be a fail or success can be by using Notification Center.
case .success,
NotificationCenter.default.post(name: Notifications.success.name,
object: message, userInfo: userInfo)
...
case .networkUnavailable,
.networkFailure:
NotificationCenter.default.post(name: Notifications.networkFailure.name,
object: message, userInfo: userInfo)
return .recoverableError(reason: .network, message: message)
...
case .quotaExceeded:
NotificationCenter.default.post(name: Notifications.quotaExceeded.name,
object: message, userInfo: userInfo)
return .fail(reason: .quotaExceeded, message: message)
}
//we would do this for all the (CKOperationResultType, CKOperationFailReason)
This is just an idea... im not sure if this is the best solution
Hi @johnnyperdomo , for the time being IceCream hasn't thrown out the error info to the outside world. So you can not know if SyncEngine
fails or not now. We'll add it in the future release.
I know that icecream already does this. But how can we interact with the error handler to update the UI accordingly. How can we know if syncEngine failed?