Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include nested path in OutOfBounds error messages #7438

Closed
elle-j opened this issue Mar 8, 2024 · 1 comment · Fixed by #7489
Closed

Include nested path in OutOfBounds error messages #7438

elle-j opened this issue Mar 8, 2024 · 1 comment · Fixed by #7489
Assignees

Comments

@elle-j
Copy link
Member

elle-j commented Mar 8, 2024

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

inline void CollectionBase::validate_index(const char* msg, size_t index, size_t size) const
{
if (index >= size) {
throw OutOfBounds(util::format("%1 on %2 '%3.%4'", msg, collection_type_name(get_collection_type()),
get_table()->get_class_name(), get_property_name()),
index, size);
}
}

Copy link

sync-by-unito bot commented Mar 8, 2024

➤ PM Bot commented:

Jira ticket: RCORE-2005

@jedelbo jedelbo assigned jedelbo and unassigned nicola-cab Mar 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants