realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
Apache License 2.0
965 stars 61 forks source link

RealmUtils.copyToRealm() name object class in "Cannot set/copyToRealm an outdated object" Exception #1846

Open MarcusWolschon opened 4 weeks ago

MarcusWolschon commented 4 weeks ago

Problem

throw IllegalArgumentException("Cannot set/copyToRealm an outdated object. Use findLatest(object) to find the version of the object required in the given context.") is often called recursive. The Exception is thus useless as it doesn't tell the developer what object in the hierarchy is outdated.

Solution

Name the class of the BaseRealmObject in the Exception message.

Alternatives

Name the hierarchy of object fields that are being assigned.

How important is this improvement for you?

Would be a major improvement

Feature would mainly be used with

Local Database only

sync-by-unito[bot] commented 4 weeks ago

➤ PM Bot commented:

Jira ticket: RKOTLIN-1134