forked from TrueCloudLab/frostfs-node
[#746] morph/client: Break loop in iterateClients
on NeoFS error
There is no need to continue iterating over Neo RPC endpoints in case of some address-independent error (e.g. NeoFS logic error). Unwrap and immediately return `neofsError` errors from loop in `iterateClients`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
a2b81f13b0
commit
18c49c2cb9
1 changed files with 5 additions and 0 deletions
|
@ -94,6 +94,11 @@ func (x *multiClient) iterateClients(f func(*Client) error) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we dont need to continue the process after the logical error was encountered
|
||||||
|
if errNeoFS := unwrapNeoFSError(err); errNeoFS != nil {
|
||||||
|
return errNeoFS
|
||||||
|
}
|
||||||
|
|
||||||
// set first error once
|
// set first error once
|
||||||
if firstErr == nil {
|
if firstErr == nil {
|
||||||
firstErr = err
|
firstErr = err
|
||||||
|
|
Loading…
Reference in a new issue