Skip to content

Commit bad6f16

Browse files
authored
Update iterator.go
1 parent 0bce70d commit bad6f16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

iterator.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,13 @@ func (iter *Iterator) Next() {
228228
}
229229

230230
node, err := iter.t.next()
231-
// TODO: double-check if this error is correctly handled.
231+
// Properly handle the error by storing it in iter.err
232232
if node == nil || err != nil {
233233
iter.t = nil
234234
iter.valid = false
235+
if err != nil {
236+
iter.err = err
237+
}
235238
return
236239
}
237240

0 commit comments

Comments
 (0)