Make Close() method on Iterators return an error

This commit is contained in:
Andrew Dunham 2015-04-14 20:17:31 -07:00
parent 5c9979ec8b
commit 1b6395ed0a
19 changed files with 89 additions and 33 deletions

View file

@ -247,11 +247,17 @@ func (it *HasA) Stats() graph.IteratorStats {
}
// Close the subiterator, the result iterator (if any) and the HasA.
func (it *HasA) Close() {
func (it *HasA) Close() error {
var ret error
if it.resultIt != nil {
it.resultIt.Close()
ret = it.resultIt.Close()
}
it.primaryIt.Close()
if err := it.primaryIt.Close(); err != nil && ret != nil {
ret = err
}
return ret
}
// Register this iterator as a HasA.