Skip to content

Commit

Permalink
Include original exception in ComponentManagerException (#1157) (#1223)
Browse files Browse the repository at this point in the history
* Include original exception in ComponentManagerException

Signed-off-by: Martijn Buijs <[email protected]>

* Update rclcpp_components/src/component_manager.cpp

Co-authored-by: tomoya <[email protected]>
Signed-off-by: Martijn Buijs <[email protected]>

Co-authored-by: tomoya <[email protected]>

Co-authored-by: Martijn Buijs <[email protected]>
Co-authored-by: tomoya <[email protected]>
  • Loading branch information
3 people authored Oct 1, 2020
1 parent b67fa59 commit cb1b32e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rclcpp_components/src/component_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ 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 cb1b32e

Please sign in to comment.