From 2d9fe510078984f8c2a8720b3406038d72f97027 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 4 Jan 2025 22:45:02 +0200 Subject: [PATCH] Ignore exceptions raised in user created tasks Signed-off-by: = --- rclpy/rclpy/executors.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rclpy/rclpy/executors.py b/rclpy/rclpy/executors.py index 4ed931276..304c54af8 100644 --- a/rclpy/rclpy/executors.py +++ b/rclpy/rclpy/executors.py @@ -851,10 +851,9 @@ def _spin_once_impl( pass else: handler() - if handler.exception() is not None: - raise handler.exception() - - handler.result() # raise any exceptions + if entity is not None: + # if the task was not created by the user + handler.result() # raise any exceptions def spin_once(self, timeout_sec: Optional[float] = None) -> None: self._spin_once_impl(timeout_sec)