diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-10-11 01:24:30 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-10-11 01:24:30 -0700 |
| commit | e6ef7b238793901ac2603d5adfb5383b0a3e9846 (patch) | |
| tree | f953b276c249705e586cd0e6e2f44c6a1b490b41 /weed/operation/assign_file_id.go | |
| parent | 4800d0ce262ab4084a181ccde36b52b6961568ac (diff) | |
| download | seaweedfs-e6ef7b238793901ac2603d5adfb5383b0a3e9846.tar.xz seaweedfs-e6ef7b238793901ac2603d5adfb5383b0a3e9846.zip | |
return error early
fix https://github.com/chrislusf/seaweedfs/issues/2370
Diffstat (limited to 'weed/operation/assign_file_id.go')
| -rw-r--r-- | weed/operation/assign_file_id.go | 8 |
1 files 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 }) |
