Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update service/client request/response API error returns #450

Merged
merged 7 commits into from
Sep 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions rmw_fastrtps_shared_cpp/src/rmw_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "rmw/error_handling.h"
#include "rmw/rmw.h"
#include "rmw/impl/cpp/macros.hpp"
#include "rmw/types.h"

#include "rmw_fastrtps_shared_cpp/custom_client_info.hpp"
Expand All @@ -38,16 +39,18 @@ __rmw_send_request(
const void * ros_request,
int64_t * sequence_id)
{
assert(client);
assert(ros_request);
assert(sequence_id);
RMW_CHECK_ARGUMENT_FOR_NULL(client, RMW_RET_INVALID_ARGUMENT);

rmw_ret_t returnedValue = RMW_RET_ERROR;
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
client handle,
Lobotuerk marked this conversation as resolved.
Show resolved Hide resolved
client->implementation_identifier, identifier,
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);

if (client->implementation_identifier != identifier) {
RMW_SET_ERROR_MSG("node handle not from this implementation");
return RMW_RET_ERROR;
}
RMW_CHECK_ARGUMENT_FOR_NULL(ros_request, RMW_RET_INVALID_ARGUMENT);

RMW_CHECK_ARGUMENT_FOR_NULL(sequence_id, RMW_RET_INVALID_ARGUMENT);

rmw_ret_t returnedValue = RMW_RET_ERROR;
Lobotuerk marked this conversation as resolved.
Show resolved Hide resolved

auto info = static_cast<CustomClientInfo *>(client->data);
assert(info);
Expand Down