diff --git a/rclcpp/src/rclcpp/exceptions.cpp b/rclcpp/src/rclcpp/exceptions.cpp index 5b8e79ea6b..6f5c40f464 100644 --- a/rclcpp/src/rclcpp/exceptions.cpp +++ b/rclcpp/src/rclcpp/exceptions.cpp @@ -39,20 +39,6 @@ NameValidationError::format_error( return msg; } -void -throw_from_rcl_error( - rcl_ret_t ret, - const std::string & prefix, - const rcl_error_state_t * error_state, - void (* reset_error)()) -{ - // We expect this to either throw a standard error, - // or to generate an error pointer (which is caught - // in err, and immediately thrown) - auto err = from_rcl_error(rt, prefix, error_state, reset_error); - std::rethrow_exception(err); -} - std::exception_ptr from_rcl_error( rcl_ret_t ret, @@ -87,6 +73,20 @@ from_rcl_error( } } +void +throw_from_rcl_error( + rcl_ret_t ret, + const std::string & prefix, + const rcl_error_state_t * error_state, + void (* reset_error)()) +{ + // We expect this to either throw a standard error, + // or to generate an error pointer (which is caught + // in err, and immediately thrown) + auto err = from_rcl_error(ret, prefix, error_state, reset_error); + std::rethrow_exception(err); +} + RCLErrorBase::RCLErrorBase(rcl_ret_t ret, const rcl_error_state_t * error_state) : ret(ret), message(error_state->message), file(error_state->file), line(error_state->line_number), formatted_message(rcl_get_error_string().str)