Skip to content

Commit

Permalink
Clear the error after rmw_serialized_message_resize() (ros2#435) (ros…
Browse files Browse the repository at this point in the history
…2#436)

It is actually an alias for rcutils_uint8_array_resize(),
so the error message isn't useful.  Instead, reset the
error and set a more useful one.

Signed-off-by: Chris Lalancette <[email protected]>
(cherry picked from commit e638f8c)

Co-authored-by: Chris Lalancette <[email protected]>
  • Loading branch information
mergify[bot] and clalancette authored Jan 24, 2025
1 parent dc70c8a commit 757dbd4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ rmw_serialize(
auto data_length = tss.get_estimated_serialized_size(ros_message, callbacks);
if (serialized_message->buffer_capacity < data_length) {
if (rmw_serialized_message_resize(serialized_message, data_length) != RMW_RET_OK) {
rmw_reset_error();
RMW_SET_ERROR_MSG("unable to dynamically resize serialized message");
return RMW_RET_ERROR;
}
Expand Down

0 comments on commit 757dbd4

Please sign in to comment.