diff --git a/graph/memstore/all_iterator.go b/graph/memstore/all_iterator.go index 26cb643..abfc105 100644 --- a/graph/memstore/all_iterator.go +++ b/graph/memstore/all_iterator.go @@ -52,6 +52,10 @@ func (it *nodesAllIterator) Next() bool { return true } +func (it *nodesAllIterator) Err() error { + return nil +} + func newQuadsAllIterator(qs *QuadStore) *quadsAllIterator { var out quadsAllIterator out.Int64 = *iterator.NewInt64(1, qs.nextQuadID-1) diff --git a/graph/memstore/iterator.go b/graph/memstore/iterator.go index d93ba62..96911af 100644 --- a/graph/memstore/iterator.go +++ b/graph/memstore/iterator.go @@ -30,6 +30,7 @@ type Iterator struct { iter *b.Enumerator data string result graph.Value + err error } func cmp(a, b int64) int { @@ -118,6 +119,7 @@ func (it *Iterator) Next() bool { } result, _, err := it.iter.Next() if err != nil { + it.err = err return graph.NextLogOut(it, nil, false) } if !it.checkValid(result) { @@ -127,6 +129,10 @@ func (it *Iterator) Next() bool { return graph.NextLogOut(it, it.result, true) } +func (it *Iterator) Err() error { + return it.err +} + func (it *Iterator) ResultTree() *graph.ResultTree { return graph.NewResultTree(it.Result()) }