Skip to content

Commit

Permalink
Fixe error messages not printing to terminal (#777) (#847)
Browse files Browse the repository at this point in the history
* Uncommented catch exception code to print error

Signed-off-by: Yathartha Tuladhar <yathartha3@gmail.com>

* put back the e

Signed-off-by: Yathartha Tuladhar <yathartha3@gmail.com>

* uncommented error printing in exception handling

Signed-off-by: Yathartha Tuladhar <yathartha3@gmail.com>

* Removed "/n" characters.
Update lifecycle_node_interface_impl.hpp

Signed-off-by: Yathartha Tuladhar <yathartha3@gmail.com>

* Fix CI issue and remove TODO

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Sep 5, 2019
1 parent 3293603 commit 25eeffd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions rclcpp_lifecycle/src/lifecycle_node_interface_impl.hpp
Expand Up @@ -425,14 +425,9 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
auto callback = it->second;
try {
cb_success = callback(State(previous_state));
} catch (const std::exception &) {
// TODO(karsten1987): Windows CI doesn't let me print the msg here
// the todo is to forward the exception to the on_error callback
// RCUTILS_LOG_ERROR("Caught exception in callback for transition %d\n",
// it->first);
// RCUTILS_LOG_ERROR("Original error msg: %s\n", e.what());
// maybe directly go for error handling here
// and pass exception along with it
} catch (const std::exception & e) {
RCUTILS_LOG_ERROR("Caught exception in callback for transition %d", it->first);
RCUTILS_LOG_ERROR("Original error: %s", e.what());
cb_success = node_interfaces::LifecycleNodeInterface::CallbackReturn::ERROR;
}
}
Expand Down

0 comments on commit 25eeffd

Please sign in to comment.