From 024a243d6c35888fc64350b52e31d5dcf5cf88a9 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 24 Jan 2025 16:07:30 -0500 Subject: [PATCH] Clear the error after rmw_serialized_message_resize() (#435) 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) --- 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; }