Skip to content

Commit

Permalink
Merge pull request #67 from hpidcock/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hpidcock authored Oct 4, 2022
2 parents ff804ce + beca9ec commit fc5d50e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
package txn

import (
stderrors "errors"
"math/rand"
"strings"
"time"

"github.com/juju/clock"
"github.com/juju/errors"
"github.com/juju/loggo"
"github.com/juju/mgo/v3"
"github.com/juju/mgo/v3/bson"
Expand Down Expand Up @@ -53,18 +53,18 @@ const (
defaultChangeLogName = "txns.log"
)

var (
const (
// ErrExcessiveContention is used to signal that even after retrying, the transaction operations
// could not be successfully applied due to database contention.
ErrExcessiveContention = stderrors.New("state changing too quickly; try again soon")
ErrExcessiveContention errors.ConstError = "state changing too quickly; try again soon"

// ErrNoOperations is returned by TransactionSource implementations to signal that
// no transaction operations are available to run.
ErrNoOperations = stderrors.New("no transaction operations are available")
ErrNoOperations errors.ConstError = "no transaction operations are available"

// ErrTransientFailure is returned by TransactionSource implementations to signal that
// the transaction list could not be built but the caller should retry.
ErrTransientFailure = stderrors.New("transient failure")
ErrTransientFailure errors.ConstError = "transient failure"
)

// TransactionSource defines a function that can return transaction operations to run.
Expand Down

0 comments on commit fc5d50e

Please sign in to comment.