diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index 270da4e60..c5d72351d 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -18,6 +18,7 @@ package model import ( "bytes" + "errors" "fmt" "path/filepath" "sort" @@ -696,11 +697,12 @@ func (tx *Transaction) doDelete(operation *Operation) (ret *TxErr) { var err error id := operation.ID tree, err := tx.loadTree(id) - if ErrBlockNotFound == err { - return nil // move 以后这里会空,算作正常情况 - } - if nil != err { + if errors.Is(err, ErrBlockNotFound) { + // move 以后这里会空,算作正常情况 + return + } + msg := fmt.Sprintf("load tree [%s] failed: %s", id, err) logging.LogErrorf(msg) return &TxErr{code: TxErrCodeBlockNotFound, id: id} @@ -926,6 +928,10 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) { tree, err := tx.loadTree(id) if nil != err { + if errors.Is(err, ErrBlockNotFound) { + return + } + logging.LogErrorf("load tree [%s] failed: %s", id, err) return &TxErr{code: TxErrCodeBlockNotFound, id: id} }