Skip to content

Commit

Permalink
unify error messages
Browse files Browse the repository at this point in the history
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
  • Loading branch information
Karsten1987 committed Oct 8, 2019
1 parent 2c2170d commit e293933
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
21 changes: 11 additions & 10 deletions rmw_fastrtps_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ rmw_publish(
eprosima_fastrtps_identifier, publisher, ros_message, allocation);
}

rmw_ret_t
rmw_publish_serialized_message(
const rmw_publisher_t * publisher,
const rmw_serialized_message_t * serialized_message,
rmw_publisher_allocation_t * allocation)
{
return rmw_fastrtps_shared_cpp::__rmw_publish_serialized_message(
eprosima_fastrtps_identifier, publisher, serialized_message, allocation);
}

rmw_ret_t
rmw_publish_loaned_message(
const rmw_publisher_t * publisher,
Expand All @@ -45,17 +55,8 @@ rmw_publish_loaned_message(
(void) ros_message;
(void) allocation;

RMW_SET_ERROR_MSG("fastrtps currently doesn't support loaned messages");
RMW_SET_ERROR_MSG("rmw_publish_loaned_message not implemented for rmw_fastrtps_cpp");
return RMW_RET_ERROR;
}

rmw_ret_t
rmw_publish_serialized_message(
const rmw_publisher_t * publisher,
const rmw_serialized_message_t * serialized_message,
rmw_publisher_allocation_t * allocation)
{
return rmw_fastrtps_shared_cpp::__rmw_publish_serialized_message(
eprosima_fastrtps_identifier, publisher, serialized_message, allocation);
}
} // extern "C"
6 changes: 6 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ rmw_take_loaned_message(
(void) loaned_message;
(void) taken;
(void) allocation;

RMW_SET_ERROR_MSG("rmw_take_loaned_message not implemented for rmw_fastrtps_cpp");
return RMW_RET_ERROR;
}

Expand All @@ -97,6 +99,8 @@ rmw_take_loaned_message_with_info(
(void) taken;
(void) message_info;
(void) allocation;

RMW_SET_ERROR_MSG("rmw_take_loaned_message_with_info not implemented for rmw_fastrtps_cpp");
return RMW_RET_ERROR;
}

Expand All @@ -107,6 +111,8 @@ rmw_release_loaned_message(
{
(void) subscription;
(void) loaned_message;

RMW_SET_ERROR_MSG("rmw_release_loaned_message_with_info not implemented for rmw_fastrtps_cpp");
return RMW_RET_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion rmw_fastrtps_dynamic_cpp/src/rmw_publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ rmw_publish_loaned_message(
(void) ros_message;
(void) allocation;

RMW_SET_ERROR_MSG("fastrtps-dynamic currently doesn't support loaned messages");
RMW_SET_ERROR_MSG("rmw_publish_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp");
return RMW_RET_ERROR;
}

Expand Down
7 changes: 7 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_take.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ rmw_take_loaned_message(
(void) loaned_message;
(void) taken;
(void) allocation;

RMW_SET_ERROR_MSG("rmw_take_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp");
return RMW_RET_ERROR;
}

Expand All @@ -97,6 +99,9 @@ rmw_take_loaned_message_with_info(
(void) taken;
(void) message_info;
(void) allocation;

RMW_SET_ERROR_MSG(
"rmw_take_loaned_message_with_info is not implemented for rmw_fastrtps_dynamic_cpp");
return RMW_RET_ERROR;
}

Expand All @@ -107,6 +112,8 @@ rmw_release_loaned_message(
{
(void) subscription;
(void) loaned_message;

RMW_SET_ERROR_MSG("rmw_release_loaned_message is not implemented for rmw_fastrtps_dynamic_cpp");
return RMW_RET_ERROR;
}

Expand Down

0 comments on commit e293933

Please sign in to comment.