[#1424] neofs-cli: Fail immediately if a client can't be created

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-24 11:38:45 +03:00 committed by LeL
parent 295ec3700a
commit 6cb9c13c5e
5 changed files with 18 additions and 11 deletions

View file

@ -152,8 +152,7 @@ func prepareAPIClient(cmd *cobra.Command, dst ...clientWithKey) {
// creates NeoFS API client and writes it to target along with the private key.
func prepareAPIClientWithKey(cmd *cobra.Command, key *ecdsa.PrivateKey, dst ...clientWithKey) {
cli, err := internalclient.GetSDKClientByFlag(key, commonflags.RPC)
common.ExitOnErr(cmd, "create API client: %w", err)
cli := internalclient.GetSDKClientByFlag(cmd, key, commonflags.RPC)
for _, d := range dst {
d.SetClient(cli)