Skip to content

Commit

Permalink
Re-ordered functions to allow compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Hassold <jhassold@dcscorp.com>
  • Loading branch information
Jacob Hassold committed Apr 16, 2019
1 parent 8fbf7b2 commit 325ba22
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions rclcpp/src/rclcpp/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 325ba22

Please sign in to comment.