How exactly do I catch RealmSwift add/delete errors?
i.e.
do {
try realm.write {
realm.delete(MyRealmObject())
}
completion(true)
} catch {
completion(false)
}
In this example I've deliberately tried deleting a RealmObject that I've just made up (to make it fail), but it doesn't catch, instead I get this error:
Terminating app due to uncaught exception 'RLMException', reason: 'Can only delete an object from the Realm it belongs to.'
I haven't seen any examples of people handling specific delete/add errors - is there a reason for this?