Browse Source

better error message

pull/1446/head
Chris Lu 4 years ago
parent
commit
ecaa30c408
  1. 5
      weed/filer/mongodb/mongodb_store.go

5
weed/filer/mongodb/mongodb_store.go

@ -109,6 +109,10 @@ func (store *MongodbStore) InsertEntry(ctx context.Context, entry *filer.Entry)
Meta: meta,
})
if err != nil {
return fmt.Errorf("InsertEntry %st: %v", entry.FullPath, err)
}
return nil
}
@ -124,6 +128,7 @@ func (store *MongodbStore) FindEntry(ctx context.Context, fullpath util.FullPath
var where = bson.M{"directory": dir, "name": name}
err = store.connect.Database(store.database).Collection(store.collectionName).FindOne(ctx, where).Decode(&data)
if err != mongo.ErrNoDocuments && err != nil {
glog.Error("find %s: %v", fullpath, err)
return nil, filer_pb.ErrNotFound
}

Loading…
Cancel
Save