@@ -401,6 +401,7 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
401401 constexpr bool publish_update = true ;
402402 State initial_state;
403403 unsigned int current_state_id;
404+ rcl_lifecycle_transition_t const * original_transition{nullptr };
404405
405406 {
406407 std::lock_guard<std::recursive_mutex> lock (state_machine_mutex_);
@@ -414,6 +415,9 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
414415 // keep the initial state to pass to a transition callback
415416 initial_state = State (state_machine_.current_state );
416417
418+ original_transition =
419+ rcl_lifecycle_get_transition_by_id (state_machine_.current_state , transition_id);
420+
417421 if (
418422 rcl_lifecycle_trigger_transition_by_id (
419423 &state_machine_, transition_id, publish_update) != RCL_RET_OK)
@@ -458,12 +462,14 @@ class LifecycleNode::LifecycleNodeInterfaceImpl
458462 current_state_id = state_machine_.current_state ->id ;
459463 }
460464
461- // error handling ?!
465+ // error handling
462466 // TODO(karsten1987): iterate over possible ret value
463467 if (cb_return_code == node_interfaces::LifecycleNodeInterface::CallbackReturn::ERROR) {
464- RCLCPP_WARN (
465- node_logging_interface_->get_logger (),
466- " Error occurred while doing error handling." );
468+ if (original_transition) {
469+ RCLCPP_WARN (
470+ node_logging_interface_->get_logger (),
471+ " Callback returned ERROR during the transition: %s" , original_transition->label );
472+ }
467473
468474 auto error_cb_code = execute_callback (current_state_id, initial_state);
469475 auto error_cb_label = get_label_for_return_code (error_cb_code);
0 commit comments