target = res.target
if self.resolve_dangling_targets(dag, [target]) == 0:
raise RuntimeError("Failed to resolve {} requested by {}. It is possible that it is not correctly generated by a previous step."
.format(", ".join(set([self.workflow.section_by_id(x._step_uuid).step_name() for x in dag.steps_depending_on(target)])),
target))
// now, there should be no dangling targets, let us connect nodes
// this can be done more efficiently