Skip to content

Commit

Permalink
store/tikv/error: remove unused error to driver package (pingcap#24426)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMouche authored May 10, 2021
1 parent 96577f9 commit f29cbd3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 7 additions & 0 deletions store/driver/txn/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ var (
ErrRegionUnavailable = dbterror.ClassTiKV.NewStd(errno.ErrRegionUnavailable)
)

// Registers error returned from TiKV.
var (
_ = dbterror.ClassTiKV.NewStd(errno.ErrDataOutOfRange)
_ = dbterror.ClassTiKV.NewStd(errno.ErrTruncatedWrongValue)
_ = dbterror.ClassTiKV.NewStd(errno.ErrDivisionByZero)
)

func genKeyExistsError(name string, value string, err error) error {
if err != nil {
logutil.BgLogger().Info("extractKeyExistsErr meets error", zap.Error(err))
Expand Down
3 changes: 0 additions & 3 deletions store/tikv/error/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ package error
const (
CodeUnknown = 1105
CodeLockWaitTimeout = 1205
CodeTruncatedWrongValue = 1292
CodeQueryInterrupted = 1317
CodeDivisionByZero = 1365
CodeDataOutOfRange = 1690
CodeLockAcquireFailAndNoWaitSet = 3572

// TiKV/PD/TiFlash errors.
Expand Down
7 changes: 0 additions & 7 deletions store/tikv/error/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ var (
ErrUnknown = dbterror.ClassTiKV.NewStd(CodeUnknown)
)

// Registers error returned from TiKV.
var (
_ = dbterror.ClassTiKV.NewStd(CodeDataOutOfRange)
_ = dbterror.ClassTiKV.NewStd(CodeTruncatedWrongValue)
_ = dbterror.ClassTiKV.NewStd(CodeDivisionByZero)
)

// IsErrNotFound checks if err is a kind of NotFound error.
func IsErrNotFound(err error) bool {
return errors.ErrorEqual(err, ErrNotExist)
Expand Down

0 comments on commit f29cbd3

Please sign in to comment.