Skip to content

Commit 2017684

Browse files
authored
Return specific error code when node is not found (#311)
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
1 parent 8f9576c commit 2017684

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

rmw_fastrtps_shared_cpp/src/rmw_node_info_and_types.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ rmw_ret_t __get_guid_by_name(
8181
});
8282

8383
if (guid_node_pair == impl->listener->discovered_names.end()) {
84-
RCUTILS_LOG_ERROR_NAMED(
85-
kLoggerTag,
86-
"Unable to find GUID for node: %s", node_name);
87-
RMW_SET_ERROR_MSG("Unable to find GUID for node ");
88-
return RMW_RET_ERROR;
84+
RMW_SET_ERROR_MSG_WITH_FORMAT_STRING(
85+
"Node name not found: ns='%s', name='%s",
86+
node_namespace,
87+
node_name
88+
);
89+
return RMW_RET_NODE_NAME_NON_EXISTENT;
8990
}
9091
guid = guid_node_pair->first;
9192
}

0 commit comments

Comments
 (0)