Handle Realm Errors - Kotlin SDK
Realm errors occur when a database read or write fails for any reason. When possible, the SDK uses existing platform exceptions, like IllegalArgumentException or IllegalStateException.
Typically, these errors result from bad database logic, like a query missing an argument or attempting to write outside of a write transaction. However, these errors can be ephemeral, so if there's no clear issue with the operation, try it again.