Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear the error after rmw_serialized_message_resize() (#435)
Browse files Browse the repository at this point in the history
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)
clalancette authored and mergify[bot] committed Jan 24, 2025
1 parent dc70c8a commit 024a243
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
@@ -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;
}

0 comments on commit 024a243

Please sign in to comment.