From 3361e68bb966668791c56d64509669a2821c5e9c Mon Sep 17 00:00:00 2001 From: Miaofei Mei Date: Thu, 19 Mar 2020 13:16:24 -0700 Subject: [PATCH] add new type of exception that may be thrown during creation of publisher/subscription (#1026) Signed-off-by: Miaofei --- rclcpp/include/rclcpp/qos_event.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rclcpp/include/rclcpp/qos_event.hpp b/rclcpp/include/rclcpp/qos_event.hpp index d14af2b..3546151 100644 --- a/rclcpp/include/rclcpp/qos_event.hpp +++ b/rclcpp/include/rclcpp/qos_event.hpp @@ -93,7 +93,11 @@ public: event_handle_ = rcl_get_zero_initialized_event(); rcl_ret_t ret = init_func(&event_handle_, parent_handle, event_type); if (ret != RCL_RET_OK) { - rclcpp::exceptions::throw_from_rcl_error(ret, "could not create event"); + if (ret == RCL_RET_UNSUPPORTED) { + rclcpp::exceptions::throw_from_rcl_error(ret, "event type is not supported"); + } else { + rclcpp::exceptions::throw_from_rcl_error(ret, "could not create event"); + } } }