Skip to content

Commit

Permalink
Return both errors
Browse files Browse the repository at this point in the history
  • Loading branch information
c2h5oh committed Dec 5, 2018
1 parent 21d5ad8 commit 54e47d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package bond
import (
"context"
"database/sql"
"errors"
"fmt"
"reflect"
"sync"

"github.com/pkg/errors"
"upper.io/db.v3"
"upper.io/db.v3/lib/sqlbuilder"
)
Expand Down Expand Up @@ -138,7 +138,7 @@ func (s *session) SessionTx(ctx context.Context, fn func(sess Session) error) er
err := txFn(t)
if err != nil {
if rErr := t.Rollback(); rErr != nil {
return rErr
return errors.Wrap(err, rErr.Error())
}
return err
}
Expand Down

0 comments on commit 54e47d9

Please sign in to comment.