def METHOD_NAME(preview_resp: PreviewResponse, dag: DAG) -> None:
    """
    Prints all the logs generated during preview, in BFS order.
    Raises:
        AqueductError:
            If the preview execution has failed. This error will have the context
            and error message of every failed operator in it.
        InternalAqueductError:
            If something unexpected happened in our system.
    """
    # There can be multiple operator failures, one for each entry.
    op_err_msgs: List[str] = []
    def _construct_failure_error_msg(op_name: str, op_result: ExecutionState) -> str:
        """This is the message is raised in the Exception message."""
        assert op_result.error is not None
        return (
            f"Operator `{op_name}` failed!\n"
            f"{op_result.error.context}\n"
            f"\n"
            f"{op_result.error.tip}\n"
            f"\n"
        )
    def _print_op_user_logs(op_name: str, logs: Logs) -> None:
        """Prints out the logs for a single operator. The format is:
        Operator {op_name} Logs:
        stdout:
            {logs}
            {logs}
        ----------------------------------
        stderr:
            {logs}
            {logs}
        If either stdout or stderr is empty, we do not print anything for
        the empty section, and do not draw the "--" delimiter line.
        """
        if logs.is_empty():
            return
        print(f"Operator {op_name} Logs:")
        print_logs(logs)
        print("")
    q: List[Operator] = dag.list_root_operators()
    seen_op_ids = set(op.id for op in q)
    while len(q) > 0:
        curr_op = q.pop(0)
        if curr_op.id in preview_resp.operator_results:
            curr_op_result = preview_resp.operator_results[curr_op.id]
            if curr_op_result.user_logs is not None:
                _print_op_user_logs(curr_op.name, curr_op_result.user_logs)
            if curr_op_result.error is not None:
                op_err_msgs.append(_construct_failure_error_msg(curr_op.name, curr_op_result))
            else:
                # Continue traversing, marking operators added to the queue as "seen"
                for output_artifact_id in curr_op.outputs:
                    next_operators = [
                        op
                        for op in dag.list_operators(on_artifact_id=output_artifact_id)
                        if op.id not in seen_op_ids
                    ]
                    q.extend(next_operators)
                    seen_op_ids.union(set(op.id for op in next_operators))
    if preview_resp.status == ExecutionStatus.PENDING:
        raise InternalAqueductError("Preview route should not be returning PENDING status.")
    if preview_resp.status == ExecutionStatus.FAILED:
        # If none of the operators failed, this must be an issue with our server.
        if len(op_err_msgs) == 0:
            raise InternalAqueductError(
                f"Unexpected Server Error! If this issue persists, please file a bug report in github: "
                f"{GITHUB_ISSUE_LINK} . We will get back to you as soon as we can.",
            )
        failure_err_msg = "\n".join(op_err_msgs)
        raise AqueductError(f"Preview Execution Failed:\n\n{failure_err_msg}\n")