diff --git a/rmw_fastrtps_shared_cpp/src/rmw_node_info_and_types.cpp b/rmw_fastrtps_shared_cpp/src/rmw_node_info_and_types.cpp index 414e17470..34d67049c 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_node_info_and_types.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_node_info_and_types.cpp @@ -81,11 +81,12 @@ rmw_ret_t __get_guid_by_name( }); if (guid_node_pair == impl->listener->discovered_names.end()) { - RCUTILS_LOG_ERROR_NAMED( - kLoggerTag, - "Unable to find GUID for node: %s", node_name); - RMW_SET_ERROR_MSG("Unable to find GUID for node "); - return RMW_RET_ERROR; + RMW_SET_ERROR_MSG_WITH_FORMAT_STRING( + "Node name not found: ns='%s', name='%s", + node_namespace, + node_name + ); + return RMW_RET_NODE_NAME_NON_EXISTENT; } guid = guid_node_pair->first; }