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

Updated error returns on rmw_take_serialized and with_message_info #242

Merged
merged 3 commits into from
Sep 18, 2020
Merged
Changes from all commits
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
18 changes: 14 additions & 4 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2638,10 +2638,16 @@ static rmw_ret_t rmw_take_ser_int(
rmw_serialized_message_t * serialized_message, bool * taken,
rmw_message_info_t * message_info)
{
RET_NULL(taken);
RET_NULL(serialized_message);
RET_NULL(subscription);
RET_WRONG_IMPLID(subscription);
RMW_CHECK_ARGUMENT_FOR_NULL(
subscription, RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_ARGUMENT_FOR_NULL(
serialized_message, RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_ARGUMENT_FOR_NULL(
taken, RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
subscription handle,
subscription->implementation_identifier, eclipse_cyclonedds_identifier,
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION)
Lobotuerk marked this conversation as resolved.
Show resolved Hide resolved
CddsSubscription * sub = static_cast<CddsSubscription *>(subscription->data);
RET_NULL(sub);
dds_sample_info_t info;
Expand Down Expand Up @@ -2718,6 +2724,10 @@ extern "C" rmw_ret_t rmw_take_serialized_message_with_info(
rmw_subscription_allocation_t * allocation)
{
static_cast<void>(allocation);

RMW_CHECK_ARGUMENT_FOR_NULL(
message_info, RMW_RET_INVALID_ARGUMENT);

return rmw_take_ser_int(subscription, serialized_message, taken, message_info);
}

Expand Down