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

[Core] Add methods to retrieve available sub-items and handle not found errors in Registry and RegistryItem #12943

Merged

Conversation

loumalouomega
Copy link
Member

@loumalouomega loumalouomega commented Dec 17, 2024

📝 Description

Add methods to retrieve available sub-items and handle not found errors in RegistryItem. Until now the error message when trying to retrieve an item were not meaningful, were just displating that the given name was not available, not displaying the list of potential candidates (as done in "legacy" KratosComponents). This message would be very helpful, because sometimes the problem may come from some typo of case sensitivity.

For example:

Registry::GetValue<Process>("Processes.KratosMultiphysics.output_process.Prototype"); // Instead of OutputProcess

Then:

C++ exception with description "Error: The item "Processes.KratosMultiphysics.output_process.Prototype" is not found in the registry. The item "KratosMultiphysics" does not have "output_process". The available objects are: 
                OutputProcess
                ApplyRayCastingProcess<3>
                ApplyRayCastingInterfaceRecognitionProcess<3>
                ApplyRayCastingInterfaceRecognitionProcess<2>
                ApplyRayCastingProcess<2>
                Process

Adding new tests.

🆕 Changelog

@loumalouomega loumalouomega changed the title [Core] Add methods to retrieve available sub-items and handle not found errors in RegistryItem [Core] Add methods to retrieve available sub-items and handle not found errors in Registry and RegistryItem Dec 17, 2024
Copy link
Member

@roigcarlo roigcarlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foine

@loumalouomega loumalouomega merged commit ec51824 into master Dec 17, 2024
11 checks passed
@loumalouomega loumalouomega deleted the core/adding-more-complete-error-message-registry branch December 17, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants