dynamic_message_introspection
dynamic_message_introspection copied to clipboard
Return error on invalid YAML fields
This change throws an std::runtime exception if a YAML has fields that don't correspond to the message, which makes it match the behavior described in the public documentation of yaml_to_rosmsg:
It is an error for the YAML representation to contain a field that is not in the ROS message.
However, an error wasn't returned. This PR makes the function throw an exception in that case, and adds a test case.