add new type of exception that may be thrown during creation of publisher/subscription (#1026)

Signed-off-by: Miaofei <miaofei@amazon.com>
This commit is contained in:
Miaofei Mei 2020-03-19 13:16:24 -07:00 committed by GitHub
parent 96ebf59a60
commit 3361e68bb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,9 +93,13 @@ public:
event_handle_ = rcl_get_zero_initialized_event(); event_handle_ = rcl_get_zero_initialized_event();
rcl_ret_t ret = init_func(&event_handle_, parent_handle, event_type); rcl_ret_t ret = init_func(&event_handle_, parent_handle, event_type);
if (ret != RCL_RET_OK) { if (ret != RCL_RET_OK) {
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"); rclcpp::exceptions::throw_from_rcl_error(ret, "could not create event");
} }
} }
}
/// Execute any entities of the Waitable that are ready. /// Execute any entities of the Waitable that are ready.
void void