Skip to content

Commit

Permalink
Remove redundant error formatting (#834)
Browse files Browse the repository at this point in the history
Follow-up to #794.
rmw_get_error_string already formats the error with the file and line number.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Oct 16, 2020
1 parent fc1a24c commit 940cb9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,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) {
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str);
RCUTILS_SAFE_FWRITE_TO_STDERR("\n");
}
}

Expand Down
4 changes: 2 additions & 2 deletions rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +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) {
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str);
RCUTILS_SAFE_FWRITE_TO_STDERR("\n");
}
}

Expand Down

0 comments on commit 940cb9b

Please sign in to comment.