rclpy icon indicating copy to clipboard operation
rclpy copied to clipboard

Add exception_callback to ActionServer

Open tonynajjar opened this issue 3 years ago • 1 comments

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

tonynajjar avatar Oct 06 '22 12:10 tonynajjar

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_callback should be added as well?
  • If exception_callback is 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

fujitatomoya avatar Oct 08 '22 17:10 fujitatomoya