Return result err in loadone if cant next

v2
Nikita Tokarchuk 4 years ago
parent 24004ff910
commit 1fdfa18740
No known key found for this signature in database
GPG Key ID: DBFD964471BAE65C
  1. 3
      mongox/database/loadone.go

@ -45,7 +45,8 @@ func (d *Database) LoadOne(target interface{}, filters ...interface{}) (err erro
hasNext := result.Next(ctx)
if result.Err() != nil {
return err
err = result.Err()
return
}
if !hasNext {
return mongox.ErrNoDocuments

Loading…
Cancel
Save