1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-23 19:11:40 +02:00

mysql/postgres: properly report entry not found

This commit is contained in:
Chris Lu 2020-09-01 22:47:57 -07:00
parent 72b0a5f1d1
commit 87d7312bf6

View file

@ -116,10 +116,13 @@ func (store *AbstractSqlStore) FindEntry(ctx context.Context, fullpath util.Full
dir, name := fullpath.DirAndName()
row := store.getTxOrDB(ctx).QueryRowContext(ctx, store.SqlFind, util.HashStringToLong(dir), name, dir)
var data []byte
if err := row.Scan(&data); err != nil {
glog.Errorf("find %s: %v", fullpath, err)
return nil, filer_pb.ErrNotFound
if err == sql.ErrNoRows {
return nil, filer_pb.ErrNotFound
}
return nil, fmt.Errorf("find %s: %v", fullpath, err)
}
entry := &filer.Entry{