Skip to content

Commit

Permalink
Update rmw_publish() error returns (#239)
Browse files Browse the repository at this point in the history
Signed-off-by: lobotuerk <jtlorente@ekumenlabs.com>
  • Loading branch information
Lobotuerk authored Sep 11, 2020
1 parent 0728b1e commit 2a1f8ef
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1505,9 +1505,15 @@ extern "C" rmw_ret_t rmw_publish(
rmw_publisher_allocation_t * allocation)
{
static_cast<void>(allocation); // unused
RET_NULL(publisher);
RET_WRONG_IMPLID(publisher);
RET_NULL(ros_message);
RMW_CHECK_FOR_NULL_WITH_MSG(
publisher, "publisher handle is null",
return RMW_RET_INVALID_ARGUMENT);
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
publisher, publisher->implementation_identifier, eclipse_cyclonedds_identifier,
return RMW_RET_INCORRECT_RMW_IMPLEMENTATION);
RMW_CHECK_FOR_NULL_WITH_MSG(
ros_message, "ros message handle is null",
return RMW_RET_INVALID_ARGUMENT);
auto pub = static_cast<CddsPublisher *>(publisher->data);
assert(pub);
if (dds_write(pub->enth, ros_message) >= 0) {
Expand Down

0 comments on commit 2a1f8ef

Please sign in to comment.