Open malhal opened 7 years ago
Todo, create CKPrettyErrors in all operations
@malhal Can you provide an example of implementing CKPrettyErrors or CKError?
Yes I could, but you might be interested in Hopper which can show the source code, pricey app but well worth it.
Thanks, I'll check it out!
I implemented CKPrettyError and have used it in some of the operations but some more need changed, if you agree to how it has been implemented. It matches how ObjC CloudKit works, it did cross my mind that Swift errors could be done differently. Anyway how it works i the operations create a CKPrettyError using a code, and then the class overrides description to output a nice string for the error, e.g.
<CKError 0x618000240c60: "Operation Cancelled" (20); "Operation <TestOperation: 0x7f876f405ea0; operationID=1644E6818C660C6E, stateFlags=executing|cancelled, qos=Utility> was cancelled before it started">
I have tried to match that format as best I could, wasn't able to get the pointer though.