Skip to content

Commit

Permalink
Include original exception in ComponentManagerException
Browse files Browse the repository at this point in the history
Signed-off-by: Martijn Buijs <martijn.buijs@gmail.com>
  • Loading branch information
Martijn Buijs committed Jun 8, 2020
1 parent bf70ce1 commit 079b66d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rclcpp_components/src/component_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ ComponentManager::OnLoadNode(

try {
node_wrappers_[node_id] = factory->create_node_instance(options);
} catch (const std::exception &ex) {
// In the case that the component constructor throws an exception,
// rethrow into the following catch block.
throw ComponentManagerException("Component constructor threw an exception: " + std::string(ex.what()));
} catch (...) {
// In the case that the component constructor throws an exception,
// rethrow into the following catch block.
Expand Down

0 comments on commit 079b66d

Please sign in to comment.