Skip to content

Commit

Permalink
use new error handling API from rcutils
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodall <william@osrfoundation.org>
  • Loading branch information
wjwwood committed Oct 31, 2018
1 parent a440a20 commit f3a62ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rcl_action/src/rcl_action/types.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ rcl_action_goal_status_array_init(
const rcl_allocator_t allocator)
{
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "invalid allocator", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(status_array, RCL_RET_INVALID_ARGUMENT, allocator);
RCL_CHECK_ARGUMENT_FOR_NULL(status_array, RCL_RET_INVALID_ARGUMENT);
// Ensure status array is zero initialized
if (status_array->status_list.size > 0) {
RCL_SET_ERROR_MSG("status_array already inititalized", allocator);
RCL_SET_ERROR_MSG("status_array already inititalized");
return RCL_RET_ALREADY_INIT;
}
// Allocate space for status array
Expand All @@ -78,7 +78,7 @@ rcl_action_goal_status_array_fini(
const rcl_allocator_t allocator)
{
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "invalid allocator", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(status_array, RCL_RET_INVALID_ARGUMENT, allocator);
RCL_CHECK_ARGUMENT_FOR_NULL(status_array, RCL_RET_INVALID_ARGUMENT);
if (!status_array->status_list.data) {
return RCL_RET_INVALID_ARGUMENT;
}
Expand All @@ -93,10 +93,10 @@ rcl_action_cancel_response_init(
const rcl_allocator_t allocator)
{
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "invalid allocator", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(cancel_response, RCL_RET_INVALID_ARGUMENT, allocator);
RCL_CHECK_ARGUMENT_FOR_NULL(cancel_response, RCL_RET_INVALID_ARGUMENT);
// Ensure cancel response is zero initialized
if (cancel_response->goals_canceling.size > 0) {
RCL_SET_ERROR_MSG("cancel_response already inititalized", allocator);
RCL_SET_ERROR_MSG("cancel_response already inititalized");
return RCL_RET_ALREADY_INIT;
}
// Allocate space for cancel response
Expand All @@ -115,7 +115,7 @@ rcl_action_cancel_response_fini(
const rcl_allocator_t allocator)
{
RCL_CHECK_ALLOCATOR_WITH_MSG(&allocator, "invalid allocator", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(cancel_response, RCL_RET_INVALID_ARGUMENT, allocator);
RCL_CHECK_ARGUMENT_FOR_NULL(cancel_response, RCL_RET_INVALID_ARGUMENT);
if (!cancel_response->goals_canceling.data) {
return RCL_RET_INVALID_ARGUMENT;
}
Expand Down

0 comments on commit f3a62ac

Please sign in to comment.