From 2f9d64821fec57fba700797c944a718c0c86a611 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 3 Nov 2020 14:08:59 +0300 Subject: [PATCH] cli: add ExitError where needed --- cli/wallet/multisig.go | 2 +- cli/wallet/nep5.go | 8 ++++---- cli/wallet/validator.go | 4 ++-- cli/wallet/wallet.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/wallet/multisig.go b/cli/wallet/multisig.go index bda83a331..4c730a33b 100644 --- a/cli/wallet/multisig.go +++ b/cli/wallet/multisig.go @@ -80,7 +80,7 @@ func signMultisig(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } res, err := c.SendRawTransaction(tx) if err != nil { diff --git a/cli/wallet/nep5.go b/cli/wallet/nep5.go index e95ceac8a..7ad69463d 100644 --- a/cli/wallet/nep5.go +++ b/cli/wallet/nep5.go @@ -156,7 +156,7 @@ func getNEP5Balance(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } err = c.Init() if err != nil { @@ -271,7 +271,7 @@ func importNEP5Token(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } tok, err := c.NEP5TokenInfo(tokenHash) @@ -364,7 +364,7 @@ func multiTransferNEP5(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } err = c.Init() if err != nil { @@ -431,7 +431,7 @@ func transferNEP5(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } err = c.Init() if err != nil { diff --git a/cli/wallet/validator.go b/cli/wallet/validator.go index 705b7667f..3efd6c4ec 100644 --- a/cli/wallet/validator.go +++ b/cli/wallet/validator.go @@ -95,7 +95,7 @@ func handleCandidate(ctx *cli.Context, method string) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } gas := flags.Fixed8FromContext(ctx, "gas") @@ -152,7 +152,7 @@ func handleVote(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } var pubArg interface{} diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index 66318f727..34564c8b7 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -230,7 +230,7 @@ func claimGas(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } neoContractHash, err := c.GetNativeContractHash("neo") @@ -426,7 +426,7 @@ func importDeployed(ctx *cli.Context) error { c, err := options.GetRPCClient(gctx, ctx) if err != nil { - return err + return cli.NewExitError(err, 1) } cs, err := c.GetContractStateByHash(h)