set filer2.ErrNotFound for not found entry

This commit is contained in:
Chris Lu
2018-07-20 02:14:18 -07:00
parent dad733086a
commit 80d80daf64
5 changed files with 21 additions and 14 deletions

View File

@@ -49,7 +49,7 @@ func (store *MemDbStore) UpdateEntry(entry *filer2.Entry) (err error) {
func (store *MemDbStore) FindEntry(fullpath filer2.FullPath) (entry *filer2.Entry, err error) {
item := store.tree.Get(entryItem{&filer2.Entry{FullPath: fullpath}})
if item == nil {
return nil, nil
return nil, filer2.ErrNotFound
}
entry = item.(entryItem).Entry
return entry, nil