Handle errors in more places in HasA Iterator
This commit is contained in:
parent
0355b89f54
commit
cacdb74e41
1 changed files with 11 additions and 1 deletions
|
|
@ -153,7 +153,11 @@ func (it *HasA) Contains(val graph.Value) bool {
|
||||||
it.resultIt.Close()
|
it.resultIt.Close()
|
||||||
}
|
}
|
||||||
it.resultIt = it.qs.QuadIterator(it.dir, val)
|
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
|
// NextContains() is shared code between Contains() and GetNextResult() -- calls next on the
|
||||||
|
|
@ -171,6 +175,9 @@ func (it *HasA) NextContains() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if err := it.resultIt.Err(); err != nil {
|
||||||
|
it.err = err
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,6 +195,9 @@ func (it *HasA) NextPath() bool {
|
||||||
}
|
}
|
||||||
result := it.NextContains()
|
result := it.NextContains()
|
||||||
glog.V(4).Infoln("HASA", it.UID(), "NextPath Returns", result, "")
|
glog.V(4).Infoln("HASA", it.UID(), "NextPath Returns", result, "")
|
||||||
|
if it.err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue