Skip to content

Commit 3361e68

Browse files
authored
add new type of exception that may be thrown during creation of publisher/subscription (#1026)
Signed-off-by: Miaofei <[email protected]>
1 parent 96ebf59 commit 3361e68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rclcpp/include/rclcpp/qos_event.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ class QOSEventHandler : public QOSEventHandlerBase
9393
event_handle_ = rcl_get_zero_initialized_event();
9494
rcl_ret_t ret = init_func(&event_handle_, parent_handle, event_type);
9595
if (ret != RCL_RET_OK) {
96-
rclcpp::exceptions::throw_from_rcl_error(ret, "could not create event");
96+
if (ret == RCL_RET_UNSUPPORTED) {
97+
rclcpp::exceptions::throw_from_rcl_error(ret, "event type is not supported");
98+
} else {
99+
rclcpp::exceptions::throw_from_rcl_error(ret, "could not create event");
100+
}
97101
}
98102
}
99103

0 commit comments

Comments
 (0)