From d4cde5df49b4165f5695f0f4d7a8e3e1aa8e50ab Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 24 Jan 2020 18:07:34 -0800 Subject: [PATCH] return empty response if not found --- weed/server/filer_grpc_server.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.go index bd0e25c80..5145035d2 100644 --- a/weed/server/filer_grpc_server.go +++ b/weed/server/filer_grpc_server.go @@ -19,6 +19,9 @@ import ( func (fs *FilerServer) LookupDirectoryEntry(ctx context.Context, req *filer_pb.LookupDirectoryEntryRequest) (*filer_pb.LookupDirectoryEntryResponse, error) { entry, err := fs.filer.FindEntry(ctx, filer2.FullPath(filepath.ToSlash(filepath.Join(req.Directory, req.Name)))) + if err == filer2.ErrNotFound { + return &filer_pb.LookupDirectoryEntryResponse{}, nil + } if err != nil { glog.V(3).Infof("LookupDirectoryEntry %s: %+v, ", filepath.Join(req.Directory, req.Name), err) return nil, err @@ -245,11 +248,11 @@ func (fs *FilerServer) AssignVolume(ctx context.Context, req *filer_pb.AssignVol } assignResult, err := operation.Assign(fs.filer.GetMaster(), fs.grpcDialOption, assignRequest, altRequest) if err != nil { - glog.V(3).Infof("AssignVolume: %v", err) + glog.V(3).Infof("AssignVolume: %v", err) return nil, fmt.Errorf("assign volume: %v", err) } if assignResult.Error != "" { - glog.V(3).Infof("AssignVolume error: %v", assignResult.Error) + glog.V(3).Infof("AssignVolume error: %v", assignResult.Error) return nil, fmt.Errorf("assign volume result: %v", assignResult.Error) }