BennyKJohnson / OpenCloudKit

Open Source CloudKit Framework
MIT License
96 stars 17 forks source link

Implementation of CKPrettyError #8

Open malhal opened 7 years ago

malhal commented 7 years ago

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.

malhal commented 7 years ago

Todo, create CKPrettyErrors in all operations

rhunt222 commented 6 years ago

@malhal Can you provide an example of implementing CKPrettyErrors or CKError?

malhal commented 6 years ago

Yes I could, but you might be interested in Hopper which can show the source code, pricey app but well worth it.

rhunt222 commented 6 years ago

Thanks, I'll check it out!