Skip to content

Commit

Permalink
PR FIXUP - Wrap close errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Jul 13, 2023
1 parent 6fb6415 commit 09f6825
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lens/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/sourcenetwork/defradb/client"
"github.com/sourcenetwork/defradb/core"
"github.com/sourcenetwork/defradb/datastore"
"github.com/sourcenetwork/defradb/errors"
)

// todo: This file, particularly the `lensPool` stuff, contains fairly sensitive code that is both
Expand Down Expand Up @@ -153,7 +154,7 @@ func (r *lensRegistry) ReloadLenses(ctx context.Context, txn datastore.Txn) erro
if res.Error != nil {
err = q.Close()
if err != nil {
return err
return errors.Wrap(err.Error(), res.Error)
}
return res.Error
}
Expand All @@ -172,7 +173,7 @@ func (r *lensRegistry) ReloadLenses(ctx context.Context, txn datastore.Txn) erro
if err != nil {
err = q.Close()
if err != nil {
return err
return errors.Wrap(err.Error(), res.Error)
}
return err
}
Expand Down

0 comments on commit 09f6825

Please sign in to comment.