forked from TrueCloudLab/frostfs-node
[#884] cli: Fix error message for undefined endpoint
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
4b8b4da681
commit
79bebe4a68
2 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,10 @@ func GetSDKClientByFlag(cmd *cobra.Command, key *ecdsa.PrivateKey, endpointFlag
|
|||
func getSDKClientByFlag(cmd *cobra.Command, key *ecdsa.PrivateKey, endpointFlag string) (*client.Client, error) {
|
||||
var addr network.Address
|
||||
|
||||
if len(viper.GetString(endpointFlag)) == 0 {
|
||||
return nil, fmt.Errorf("%s is not defined", endpointFlag)
|
||||
}
|
||||
|
||||
err := addr.FromString(viper.GetString(endpointFlag))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%v: %w", errInvalidEndpoint, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue