Skip to content

Commit

Permalink
Avoid stack traces when aborting an advertised action goal (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-bass authored Feb 5, 2024
1 parent 48a1c62 commit 4e49c3f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ async def execute_callback(self, goal: Any) -> Any:
def done_callback(fut: rclpy.task.Future()) -> None:
if fut.cancelled():
goal.abort()
fut.set_exception(RuntimeError(f"Aborted goal {goal_id}"))
self.protocol.log("info", f"Aborted goal {goal_id}")
# Send an empty result to avoid stack traces
fut.set_result(get_action_class(self.action_type).Result())
else:
goal.succeed()

Expand Down

0 comments on commit 4e49c3f

Please sign in to comment.