diff --git a/rcl/src/rcl/publisher.c b/rcl/src/rcl/publisher.c index 6164665568..6662aca0f2 100644 --- a/rcl/src/rcl/publisher.c +++ b/rcl/src/rcl/publisher.c @@ -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__); } } diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 2f987a4ca7..e9c2748aa2 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -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__); } }