I’m not able to catch any major exceptions inside of Realm. Is this expected behavior? I can’t think of one exception that has gotten caught that I can remember. Thankfully permission ones seem where you write to a synced realm in a way you don’t have permission for do work fine. Here’s a code example:
do {
try realm.write {
realm.delete(Task(ownerId: "asdf")) // Throws of course
}
} catch let error as NSError {
print(error.localizedDescription)
}
In this code I’d expect the write to fail and an error get caught and printed. Instead the app crashes due to an uncaught exception.
*** Terminating app due to uncaught exception ‘RLMException’, reason: ‘Can only delete an object from the Realm it belongs to.’
What can I do to fix this?
What kind of exceptions do get caught?
Thanks
-Jon