From 1bf435a06798236940d9a7b2922ea96bb3fd8807 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 19 Dec 2024 21:47:02 +0000 Subject: [PATCH] Remove unnecessary error reporting. The rosidl_stringify_type_hash() function already sets the error when it fails, so we should not do it again (this leads to some ugly output). Signed-off-by: Chris Lalancette --- rmw_zenoh_cpp/src/detail/rmw_client_data.cpp | 2 +- rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp | 2 +- rmw_zenoh_cpp/src/detail/rmw_service_data.cpp | 2 +- rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp index 1c24570d..f85dab86 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp @@ -100,7 +100,7 @@ std::shared_ptr ClientData::make( *allocator, &type_hash_c_str); if (RCUTILS_RET_BAD_ALLOC == stringify_ret) { - RMW_SET_ERROR_MSG("Failed to allocate type_hash_c_str."); + // rosidl_stringify_type_hash already set the error return nullptr; } auto free_type_hash_c_str = rcpputils::make_scope_exit( diff --git a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp index 7d83eec6..3bf62372 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp @@ -74,7 +74,7 @@ std::shared_ptr PublisherData::make( *allocator, &type_hash_c_str); if (RCUTILS_RET_BAD_ALLOC == stringify_ret) { - RMW_SET_ERROR_MSG("Failed to allocate type_hash_c_str."); + // rosidl_stringify_type_hash already set the error return nullptr; } auto always_free_type_hash_c_str = rcpputils::make_scope_exit( diff --git a/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp index 9fe075a9..769ff47e 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp @@ -95,7 +95,7 @@ std::shared_ptr ServiceData::make( *allocator, &type_hash_c_str); if (RCUTILS_RET_BAD_ALLOC == stringify_ret) { - RMW_SET_ERROR_MSG("Failed to allocate type_hash_c_str."); + // rosidl_stringify_type_hash already set the error return nullptr; } auto free_type_hash_c_str = rcpputils::make_scope_exit( diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp index 5acbd909..cce67b33 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp @@ -88,7 +88,7 @@ std::shared_ptr SubscriptionData::make( *allocator, &type_hash_c_str); if (RCUTILS_RET_BAD_ALLOC == stringify_ret) { - RMW_SET_ERROR_MSG("Failed to allocate type_hash_c_str."); + // rosidl_stringify_type_hash already set the error return nullptr; } auto free_type_hash_c_str = rcpputils::make_scope_exit(