rclpy
rclpy copied to clipboard
Add exception_callback to ActionServer
Feature request
Feature description
This PR added the handling of exceptions in the user's execute_callback.
I would like to execute some commands whenever an action server has an exception, for example publishing an error message to a topic. I therefore propose to add exception_callback as a new argument to ActionServer, which is a user-provided callback executed when an action server has an exception.
Implementation considerations
I agree with this approach.
This would be worth to discuss in general for ROS 2 client libraries perspective, including rclcpp.
- There are other classes that
exception_callbackshould be added as well? - If
exception_callbackis not added by user application, raise the exception up to user application?
I think it would be nice to discuss on basic policy so that we can keep the behavior consistent.
@ros2/team