I know this is an old question, but you can test this kind of error-handling logic by temporarily adding code to throw these errors, e.g.:
throw CKError(.requestRateLimited, [CKErrorRetryAfterKey: NSNumber(value: 10)
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: