From 8de90f66aacb98f744f5d1f64e52a19e89fd5883 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 6 Feb 2019 13:52:19 -0800 Subject: [PATCH] Set error message when there is an invalid goal transition Signed-off-by: Jacob Perron --- rcl_action/src/rcl_action/goal_handle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rcl_action/src/rcl_action/goal_handle.c b/rcl_action/src/rcl_action/goal_handle.c index 903b272..5add061 100644 --- a/rcl_action/src/rcl_action/goal_handle.c +++ b/rcl_action/src/rcl_action/goal_handle.c @@ -88,6 +88,10 @@ rcl_action_update_goal_state( rcl_action_goal_state_t new_state = rcl_action_transition_goal_state( goal_handle->impl->state, goal_event); if (GOAL_STATE_UNKNOWN == new_state) { + RCL_SET_ERROR_MSG_WITH_FORMAT_STRING( + "goal_handle attempted invalid transition from state %d with event %d", + goal_handle->impl->state, + goal_event); return RCL_RET_ACTION_GOAL_EVENT_INVALID; } goal_handle->impl->state = new_state;