Skip to content

Commit

Permalink
Avoid setting error message twice. (ros2#887)
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Lihui <Lihui.Chen@sony.com>
  • Loading branch information
Chen Lihui authored Jan 28, 2021
1 parent 2883ce4 commit 7a25a74
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rcl_action/src/rcl_action/action_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ _rcl_action_client_fini_impl(
char * Type ## _service_name = NULL; \
ret = rcl_action_get_ ## Type ## _service_name(action_name, allocator, &Type ## _service_name); \
if (RCL_RET_OK != ret) { \
rcl_reset_error(); \
RCL_SET_ERROR_MSG("failed to get " #Type " service name"); \
if (RCL_RET_BAD_ALLOC == ret) { \
ret = RCL_RET_BAD_ALLOC; \
Expand Down Expand Up @@ -138,6 +139,7 @@ _rcl_action_client_fini_impl(
char * Type ## _topic_name = NULL; \
ret = rcl_action_get_ ## Type ## _topic_name(action_name, allocator, &Type ## _topic_name); \
if (RCL_RET_OK != ret) { \
rcl_reset_error(); \
RCL_SET_ERROR_MSG("failed to get " #Type " topic name"); \
if (RCL_RET_BAD_ALLOC == ret) { \
ret = RCL_RET_BAD_ALLOC; \
Expand Down

0 comments on commit 7a25a74

Please sign in to comment.