Hi
[ My Question ]
In persistent.swift (or datacontroller as Paul usually named), there are many "fatalError," couldn't be remained in shipped app. But What is the correct way to handle them?
[ What I have known/ tried ]
I found https://developer.apple.com/documentation/coredata/nsmanagedobject/1535452-validation_error_codes
so I can decode the error.
I have googled and search stack overflow for several days, but I do not get any concret information.
One I have seen replied that there is no point to handle in production app, because if there is not enough space, apple will have been notify the user several times, and for other error, there is nothing a developer can do to recover.
Some said it is important to notify the user if it doesn't save successfully.
[ My remaining question after above efforts ]
However, I do not know what to do with those error...
For example, assuming the user fails to context.save()
Firstly, I don't know which error might occur under which command, and even I try to pick those I think most likely happened as below:
NSMigrationManagerDestinationStoreError, NSMigrationManagerSourceStoreError, NSPersistentStoreIncompleteSaveError, or NSPersistentStoreSaveError....
I don't know what I should do after knowing the error source.
Tell user there is a save error ask him to try again later?
Try to save again silently?
If there is a merge error, what could i do?
If they don't find model in store, what could I do?
If i create a new one, then it won't be the same as previous one.......
I see many of you have release in appconnect,
It would be so nice if you like to share your experience?
Thank you very much!