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>support/v0.27
parent
a2b81f13b0
commit
18c49c2cb9
|
@ -94,6 +94,11 @@ func (x *multiClient) iterateClients(f func(*Client) error) error {
|
|||
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
|
||||
if firstErr == nil {
|
||||
firstErr = err
|
||||
|
|
Loading…
Reference in New Issue