Handle errors in more places in HasA Iterator

This commit is contained in:
Andrew Dunham 2015-04-15 13:51:46 -07:00
parent 0355b89f54
commit cacdb74e41

View file

@ -153,7 +153,11 @@ func (it *HasA) Contains(val graph.Value) bool {
it.resultIt.Close()
}
it.resultIt = it.qs.QuadIterator(it.dir, val)
return graph.ContainsLogOut(it, val, it.NextContains())
ret := it.NextContains()
if it.err != nil {
return false
}
return graph.ContainsLogOut(it, val, ret)
}
// NextContains() is shared code between Contains() and GetNextResult() -- calls next on the
@ -171,6 +175,9 @@ func (it *HasA) NextContains() bool {
return true
}
}
if err := it.resultIt.Err(); err != nil {
it.err = err
}
return false
}
@ -188,6 +195,9 @@ func (it *HasA) NextPath() bool {
}
result := it.NextContains()
glog.V(4).Infoln("HASA", it.UID(), "NextPath Returns", result, "")
if it.err != nil {
return false
}
return result
}