diff --git a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp index e1647180..170cf54c 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp @@ -142,11 +142,6 @@ std::shared_ptr ClientData::make( response_type_support }); - if (!client_data->init()) { - // init() already set the error. - return nullptr; - } - return client_data; } @@ -172,12 +167,6 @@ ClientData::ClientData( sequence_number_(1), is_shutdown_(false), initialized_(false) -{ - // Do nothing. -} - -///============================================================================= -bool ClientData::init() { std::string topic_keyexpr = this->entity_->topic_info().value().topic_keyexpr_; keyexpr_ = zenoh::KeyExpr(topic_keyexpr); @@ -191,12 +180,10 @@ bool ClientData::init() RMW_ZENOH_LOG_ERROR_NAMED( "rmw_zenoh_cpp", "Unable to create liveliness token for the client."); - return false; + throw std::runtime_error("Unable to create liveliness token for the client."); } initialized_ = true; - - return true; } ///============================================================================= diff --git a/rmw_zenoh_cpp/src/detail/rmw_client_data.hpp b/rmw_zenoh_cpp/src/detail/rmw_client_data.hpp index 6f753955..44b187ba 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_client_data.hpp +++ b/rmw_zenoh_cpp/src/detail/rmw_client_data.hpp @@ -114,9 +114,6 @@ class ClientData final : public std::enable_shared_from_this std::shared_ptr request_type_support, std::shared_ptr response_type_support); - // Initialize the Zenoh objects for this entity. - bool init(); - // Internal mutex. mutable std::recursive_mutex mutex_; // The parent node.