Skip to content

Commit

Permalink
Remove unnecessary error reporting. (#352)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
clalancette authored Dec 20, 2024
1 parent 49a34bf commit 65e0cab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ std::shared_ptr<ClientData> 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(
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ std::shared_ptr<PublisherData> 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(
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ std::shared_ptr<ServiceData> 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(
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ std::shared_ptr<SubscriptionData> 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(
Expand Down

0 comments on commit 65e0cab

Please sign in to comment.