Skip to content

Commit

Permalink
Return specific error code when node is not found (#311)
Browse files Browse the repository at this point in the history
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
  • Loading branch information
ivanpauno authored Sep 17, 2019
1 parent 8f9576c commit 2017684
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rmw_fastrtps_shared_cpp/src/rmw_node_info_and_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2017684

Please sign in to comment.