mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
leveldb: report not found entry
This commit is contained in:
parent
87d7312bf6
commit
aa40295f06
|
@ -3,6 +3,8 @@ package leveldb
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/chrislusf/seaweedfs/weed/filer"
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
)
|
||||
|
||||
func (store *LevelDBStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) {
|
||||
|
@ -20,6 +22,10 @@ func (store *LevelDBStore) KvGet(ctx context.Context, key []byte) (value []byte,
|
|||
|
||||
value, err = store.db.Get(key, nil)
|
||||
|
||||
if err == leveldb.ErrNotFound {
|
||||
return nil, filer.ErrKvNotFound
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("kv get: %v", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue