-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New ErrorHandler class #15
Conversation
…tential CKError.codes as they arise Modified SyncEngine code to use CKErrorHandler class where appropriate
Thanks @randycarney! I've checked your code and it seems great! But it takes time for me to review it in detail. And I am gonna tell you my thoughts on this later. Thank you again! |
Reference issue #13 |
Is it a good idea to use That could cause conflicts in the future if Apple changes their API with types which have the same names. |
Fair point, I wasn't sure what to name it! CloudKitErrorHandler? ErrorHandler? |
Replaced ErrrorMessageForUser struct as a simpler String type. Instead, added a message to certain ErrorTypes that could be displayed to the user. Re-classified network-related failure codes as ErrorType.recoverableError s(user should take action) instead of retry Re-classified func retryOperationIfPossible(retryafter:block) as type method (“static”) Moved Array extension for chunking to ErrorHandler file - Cleaned up Header
Replaced ErrrorMessageForUser struct as a simpler String type. Instead, added a message to certain ErrorTypes that could be displayed to the user. Re-classified network-related failure codes as ErrorType.recoverableError s(user should take action) instead of retry Re-classified func retryOperationIfPossible(retryafter:block) as type method (“static”) Moved Array extension for chunking to ErrorHandler file - Cleaned up Header
I think going without a prefix is the best approach here. |
1. Remove some comments 2. Optimize the code
Hi @randycarney, I've made some changes and code has become much cleaner and reasonable now. Hope to receive your comments. |
This is great, nice job. Fine for |
@randycarney Yep, I've made it an instance method. Time to merge. |
My first pull request! 💯 |
Congrats man! Seems that you've learned so fast. But I have some tips for you:
You can do better in the future! Thanks! |
Awesome, thanks for the advice. I learned a lot from your edits too! |
@randycarney Congrats on your first pull request 🎉 |
Implemented a new class called "CKErrorHandler" to switch on the generated error code and handle any and all potential CKError.codes should they arise.
I modified SyncEngine to use the CKErrorHandler class where appropriate.