Skip to content

Commit

Permalink
Output error message to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry-Xu-2018 committed Oct 14, 2020
1 parent 0951701 commit e631b5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ rcl_publisher_init(
rmw_ret_t rmw_fail_ret = rmw_destroy_publisher(
rcl_node_get_rmw_handle(node), publisher->impl->rmw_handle);
if (RMW_RET_OK != rmw_fail_ret) {
RCL_SET_ERROR_MSG(rmw_get_error_string().str);
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
}
}

Expand Down
3 changes: 2 additions & 1 deletion rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ rcl_subscription_init(
rmw_ret_t rmw_fail_ret = rmw_destroy_subscription(
rcl_node_get_rmw_handle(node), subscription->impl->rmw_handle);
if (RMW_RET_OK != rmw_fail_ret) {
RCL_SET_ERROR_MSG(rmw_get_error_string().str);
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
}
}

Expand Down

0 comments on commit e631b5a

Please sign in to comment.