         print(plan.serialize())
         
         let seq = AnySequence { () -> AnyIterator<TermResult> in
-            guard let i = try? plan.evaluate() else {
-                print("*** Failed to evaluate query plan in Sequence construction")
+            do {
+                let i = try plan.evaluate()
+                return i
+//                let a = Array(i)
+//                print(">>> \(a)")
+//                return AnyIterator(a.makeIterator())
+            } catch let error {
+                print("*** Failed to evaluate query plan in Sequence construction: \(error)")
                 return AnyIterator([].makeIterator())
-            }
-//            return i
-            let a = Array(i)
-            print(">>> \(a)")
-            return AnyIterator(a.makeIterator())
+                //                throw error
+            }
         }
         switch q.form {
         case .ask:


public struct QueryPlanEvaluator<Q: QuadStoreProtocol> {
    var dataset: Dataset
    var planner: QueryPlanner<Q>
    
    public init(dataset: Dataset, store: Q, base: String? = nil) {
        self.dataset = dataset

}

public class QueryPlanner<Q: QuadStoreProtocol> {
    public var allowStoreOptimizedPlans: Bool
    public var store: Q
    public var dataset: Dataset
    public var evaluator: ExpressionEvaluator
