ros2 / rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
Apache License 2.0
13 stars 34 forks source link

Ensure typesupport handle functions do not throw. #99

Closed hidmic closed 3 years ago

hidmic commented 3 years ago

While working on #98, I stumbled upon this inconsistency in error handling within typesupport handle functions.

These functions are eventually called by rmw implementations with no consideration for potential exceptions. If we add that no API documentation mentions exceptions and that some of these APIs even have C linkage, I'm inclined to assume these functions shouldn't ever throw to begin with.

hidmic commented 3 years ago

CI up to rosidl_typesupport_c, rosidl_typesupport_cpp, and test_communication:

brawner commented 3 years ago

For rosidl_typesupport_cpp, what do you think about adding noexcept to make it clear calling code won't need to catch exceptions?

hidmic commented 3 years ago

what do you think about adding noexcept

Good idea! See https://github.com/ros2/rosidl_typesupport/pull/99/commits/c27aeb7eb663763393170e07cb67d6859773d569.

hidmic commented 3 years ago

Alright! CI is happy, reviewer is happy, I'm happy. Merging.