Comments (6)
@IngmarStein @harryworld @insidegui
Gentlemen, I've received a pull request from @randycarney and made lots of changes to that. And I am really happy to announce that:
IceCream is equipped with a powerful ErrorHandler now!
For the details, you guys could take a look the #15. In that pr, ErrorHandler
has taken care of all the error codes that CloudKit returns.
Check it now! Thanks to all of you.
from icecream.
In practice, we always handle these following errors:
limitExceeded
400 records per operation, or 2MB per request -> Split itquotaExceeded
iCloud space is used up -> Show alert messagepartialFailure
in case of using default savePolicy
In addition, one may optionally handle the unrecoverable errors like
unknownItem
internalError
from icecream.
@caiyue1993 This can be fixed by splitting the items into batches of at most 400 at a time.
from icecream.
@IngmarStein Thanks a lot for raising this issue and detailed suggestions! IceCream library truly should handle this case.
And yep, we could fix this by the way @insidegui suggested.
I'm on it and keep tuned.
from icecream.
@harryworld I appreciate it a lot!
Thanks for you practical advice and I'll check out my code. 👍
from icecream.
I just submitted a pull request from my fork CKErrorHandler to address the errors specifically where appropriate, based on the error handling from the GitHub library EVCloudKitDao: https://github.com/evermeer/EVCloudKitDao.
It basically divides all the potential CKError codes into CKErrorTypes that you can switch on and handle with custom code.
public enum CKErrorType {
case success
case retry(afterSeconds: Double)
case recoverableError(reason: CKFailReason)
case chunk
case fail(reason: CKFailReason)
}
public enum CKFailReason {
case changeTokenExpired
case quotaExceeded
case partialFailure
case serverRecordChanged
case shareRelated
case unhandledErrorCode
case unknown
}
It also provides a NSLog message copied from the Apple Documentation that could be turned into a button to notify the user easily.
I implemented CKErrorHandler in all the places in SyncEngine it would be currently appropriate as far as I can tell.
I also made the CKModifyRecordsOperation .isAtomic flag true to avoid CKError.partialFailure errors, though some may want to handle those specifically.
Let me know what you think!
from icecream.
Related Issues (20)
- is List<CreamAsset>() legal?
- 更新到2.0.4,在iOS15下依然崩溃 HOT 3
- Is it possible to use prebuilt Realm framework along with IceCream? HOT 1
- IceCream Doesn't work with SwiftUI Preview HOT 1
- 请教一下,当我同时需要同步私有库和公共库的时候,应该用哪种写法呢? HOT 1
- where is ListBase? HOT 1
- Permission Denied HOT 1
- what do uListElementType,vListElementType,wListElementType mean, does Syncobject support up to three type of list at most?
- crash in resumeLongLivedOperationIfPossible HOT 2
- Migration not working
- Sync UserDefault Key-Value using IceCream
- Warning about use of private API when uploading app with Xcode 14 HOT 1
- Generic class 'SyncObject' requires that 'String' inherit from 'RealmSwiftObject' HOT 1
- Cannot find type 'ListBase' in scope HOT 1
- deleted data cannot sync to private database
- Continuing the sync again after the sync was interrupted does not restore the relationship
- Merge latest realm support to 'realm-latest' branch HOT 1
- Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects lose data HOT 1
- How to ignore an Object with specific type sync to cloud? HOT 1
- Unable to Compile/'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icecream.