Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-2005

Include nested path in `OutOfBounds` error messages

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Describe your problem or use case

      Out of bounds error messages from Core for nested collections currently report the requested index of the nested collection, but not the nested path. E.g.:

      nested_empty_list = [];
      obj.mixed = [ nested_empty_list ];
      
      // Throws e.g.: Requested index 1 calling set_collection() on list 'MixedClass.mixed' when empty
      obj.mixed[0][1];
      

      Describe the solution you'd like

      It would be clearer if the nested path could be depicted as well, e.g.:

      Requested index 1 calling set_collection() on list 'MixedClass.mixed[0]' when empty
      

      Additional context

      https://github.com/realm/realm-core/blob/f294a0b55e7b4daf430a1df5dcaf57547cec1bfd/src/realm/collection.hpp#L273-L280

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            unitosyncbot Unito Sync Bot
            AD Core
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: