1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-30 14:21:00 +02:00

return error early

fix https://github.com/chrislusf/seaweedfs/issues/2370
This commit is contained in:
Chris Lu 2021-10-11 01:24:30 -07:00
parent 4800d0ce26
commit e6ef7b2387

View file

@ -66,6 +66,10 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
return grpcErr
}
if resp.Error != "" {
return fmt.Errorf("assignRequest: %v", resp.Error)
}
ret.Count = resp.Count
ret.Fid = resp.Fid
ret.Url = resp.Location.Url
@ -80,10 +84,6 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
})
}
if resp.Error != "" {
return fmt.Errorf("assignRequest: %v", resp.Error)
}
return nil
})