From b45a8ec945452d1a78a41dfac9fdc40b239b191b Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Tue, 15 Dec 2020 17:14:11 -0300 Subject: [PATCH] Handle rmw_fastrtps_dynamic_cpp client typesupport errors too Signed-off-by: Michel Hidalgo --- rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp index e6413bf6b..ed9572504 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp @@ -97,12 +97,19 @@ rmw_create_client( const rosidl_service_type_support_t * type_support = get_service_typesupport_handle( type_supports, rosidl_typesupport_introspection_c__identifier); if (!type_support) { + rcutils_error_string_t prev_error_string = rcutils_get_error_string(); rcutils_reset_error(); type_support = get_service_typesupport_handle( type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier); if (!type_support) { + rcutils_error_string_t error_string = rcutils_get_error_string(); rcutils_reset_error(); - RMW_SET_ERROR_MSG("type support not from this implementation"); + RMW_SET_ERROR_MSG_WITH_FORMAT_STRING( + "Type support not from this implementation. Got:\n" + " %s\n" + " %s\n" + "while fetching it", + prev_error_string.str, error_string.str); return nullptr; } }