Skip to content

Commit

Permalink
cli: Do not unwrap dial errors manually
Browse files Browse the repository at this point in the history
`status.Code` function supports wrapped errors, so it's redundant to do
`errors.Unwrap` before.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Feb 27, 2024
1 parent fbe87b0 commit a4900da
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/neofs-cli/internal/client/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ func GetSDKClient(ctx context.Context, addr network.Address) (*client.Client, er
// This behavior is going to be fixed on SDK side.
//
// Track https://github.com/nspcc-dev/neofs-node/issues/2477
wErr := err
for e := errors.Unwrap(wErr); e != nil; e = errors.Unwrap(wErr) {
wErr = e
}
if status.Code(wErr) == codes.Unimplemented {
if status.Code(err) == codes.Unimplemented {
return c, nil
}
return nil, fmt.Errorf("can't init SDK client: %w", err)
Expand Down

0 comments on commit a4900da

Please sign in to comment.