From bd2b2b73cff3e8cb4a697c43401170bf055bb62d Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Tue, 14 Apr 2015 19:11:39 -0700 Subject: [PATCH] Fix Err fallout for graph/mongo iterator --- graph/mongo/iterator.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graph/mongo/iterator.go b/graph/mongo/iterator.go index bdd3bab..bbe1b4f 100644 --- a/graph/mongo/iterator.go +++ b/graph/mongo/iterator.go @@ -39,6 +39,7 @@ type Iterator struct { constraint bson.M collection string result graph.Value + err error } func NewIterator(qs *QuadStore, collection string, d quad.Direction, val graph.Value) *Iterator { @@ -137,6 +138,7 @@ func (it *Iterator) Next() bool { if !found { err := it.iter.Err() if err != nil { + it.err = err glog.Errorln("Error Nexting Iterator: ", err) } return false @@ -148,6 +150,10 @@ func (it *Iterator) Next() bool { return true } +func (it *Iterator) Err() error { + return it.err +} + func (it *Iterator) ResultTree() *graph.ResultTree { return graph.NewResultTree(it.Result()) }