Test for errors in .Contains() and .NextPath()

This commit is contained in:
Andrew Dunham 2015-04-15 15:28:46 -07:00
parent 7de923d40a
commit 430ff507f0
8 changed files with 71 additions and 11 deletions

View file

@ -126,6 +126,9 @@ func (it *LinksTo) Contains(val graph.Value) bool {
it.result = val
return graph.ContainsLogOut(it, val, true)
}
if err := it.primaryIt.Err(); err != nil {
it.err = err
}
return graph.ContainsLogOut(it, val, false)
}
@ -213,7 +216,11 @@ func (it *LinksTo) Close() error {
// We won't ever have a new result, but our subiterators might.
func (it *LinksTo) NextPath() bool {
return it.primaryIt.NextPath()
ret := it.primaryIt.NextPath()
if !ret {
it.err = it.primaryIt.Err()
}
return ret
}
// Register the LinksTo.