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,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");
}
}
}