Improve evaluate_paramenter_dict exceptions error message #320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the
evaluate_paramenter_dict()
possible exceptions adding the name of the parameter that caused the exception, thus helping find the root of the problem when it occursFor example, if a
NoneType
argument is passed to the function, the thrown message would beWithin a large project, with dozens of launch arguments, it is not trivial to discover which argument received the invalid value. As the name of the argument being evaluated is already available in the scope of the exception, adding it to the error message would be really helpful when dealing with this problem.
As discussed in some ROS 2 tickets (#291, ros2/launch#412), one of the main issues of the launch system is the lack of helpful information when something goes wrong, this PR is a small step in the direction of solving this issue