From 757dbd42a6756c2fbf87ba31ba603a991a780f16 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 22:34:06 +0100 Subject: [PATCH] Clear the error after rmw_serialized_message_resize() (#435) (#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 (cherry picked from commit e638f8c5ea79d614596ea4dfa89f07dc8065ad93) Co-authored-by: Chris Lalancette --- rmw_zenoh_cpp/src/rmw_zenoh.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index a21eeb22..a6a47c6c 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -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; }