Add API StateMachine.getLastException