From e6ef7b238793901ac2603d5adfb5383b0a3e9846 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 11 Oct 2021 01:24:30 -0700 Subject: [PATCH] return error early fix https://github.com/chrislusf/seaweedfs/issues/2370 --- weed/operation/assign_file_id.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go index 9eac69631..b4d44eccf 100644 --- a/weed/operation/assign_file_id.go +++ b/weed/operation/assign_file_id.go @@ -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 })