diff --git a/src/robomaster/action.py b/src/robomaster/action.py index e5f9c70..34ca5a9 100644 --- a/src/robomaster/action.py +++ b/src/robomaster/action.py @@ -241,8 +241,11 @@ def _update_action_state(self, proto_state): self._changeto_state(ACTION_SUCCEEDED) elif proto_state == 'error': self._changeto_state(ACTION_FAILED) + self._failure_reason = proto_state logger.error("TextAction: action failed ! resp: {0}".format(proto_state)) else: + self._changeto_state(ACTION_FAILED) + self._failure_reason = proto_state logger.error("TextAction: action failed ! resp: {0}".format(proto_state)) def make_action_key(self):